Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 35361ee

Browse files
committed
Restrict vertical tightness to parentheses in Perl code
The vertical tightness settings collapse vertical whitespace between opening and closing brackets (parentheses, square brakets and braces). This can make data structures in particular harder to read, and is not very consistent with our style in non-Perl code. This patch restricts that setting to parentheses only, and reformats all the perl code accordingly. Not applying this to parentheses has some unfortunate effects, so the consensus is to keep the setting for parentheses and not for the others. The diff for this patch does highlight some places where structures should have trailing commas. They can be added manually, as there is no automatic tool to do so. Discussion: https://postgr.es/m/a2f2b87c-56be-c070-bfc0-36288b4b41c1@2ndQuadrant.com
1 parent 286bb24 commit 35361ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1815
-851
lines changed

src/backend/catalog/Catalog.pm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,12 @@ sub ParseHeader
9595
elsif (/^DECLARE_(UNIQUE_)?INDEX\(\s*(\w+),\s*(\d+),\s*(.+)\)/)
9696
{
9797
push @{ $catalog{indexing} },
98-
{ is_unique => $1 ? 1 : 0,
98+
{
99+
is_unique => $1 ? 1 : 0,
99100
index_name => $2,
100101
index_oid => $3,
101-
index_decl => $4 };
102+
index_decl => $4
103+
};
102104
}
103105
elsif (/^CATALOG\((\w+),(\d+),(\w+)\)/)
104106
{

src/backend/utils/Gen_fmgrtab.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@
9797
next if $bki_values{prolang} ne $INTERNALlanguageId;
9898

9999
push @fmgr,
100-
{ oid => $bki_values{oid},
100+
{
101+
oid => $bki_values{oid},
101102
strict => $bki_values{proisstrict},
102103
retset => $bki_values{proretset},
103104
nargs => $bki_values{pronargs},
104-
prosrc => $bki_values{prosrc}, };
105+
prosrc => $bki_values{prosrc},
106+
};
105107
}
106108

107109
# Emit headers for both files

src/backend/utils/mb/Unicode/UCS_to_BIG5.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@
4848
&& $code <= 0xf9dc)
4949
{
5050
push @$all,
51-
{ code => $code,
51+
{
52+
code => $code,
5253
ucs => $ucs,
5354
comment => $i->{comment},
5455
direction => BOTH,
5556
f => $i->{f},
56-
l => $i->{l} };
57+
l => $i->{l}
58+
};
5759
}
5860
}
5961

src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@
7070
}
7171

7272
push @mapping,
73-
{ ucs => $ucs,
73+
{
74+
ucs => $ucs,
7475
code => $code,
7576
direction => BOTH,
7677
f => $in_file,
77-
l => $. };
78+
l => $.
79+
};
7880
}
7981
close($in);
8082

src/backend/utils/mb/Unicode/UCS_to_EUC_JIS_2004.pl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@
3333
my $ucs2 = hex($u2);
3434

3535
push @all,
36-
{ direction => BOTH,
36+
{
37+
direction => BOTH,
3738
ucs => $ucs1,
3839
ucs_second => $ucs2,
3940
code => $code,
4041
comment => $rest,
4142
f => $in_file,
42-
l => $. };
43+
l => $.
44+
};
4345
}
4446
elsif ($line =~ /^0x(.*)[ \t]*U\+(.*)[ \t]*#(.*)$/)
4547
{
@@ -52,12 +54,14 @@
5254
next if ($code < 0x80 && $ucs < 0x80);
5355

5456
push @all,
55-
{ direction => BOTH,
57+
{
58+
direction => BOTH,
5659
ucs => $ucs,
5760
code => $code,
5861
comment => $rest,
5962
f => $in_file,
60-
l => $. };
63+
l => $.
64+
};
6165
}
6266
}
6367
close($in);

0 commit comments

Comments
 (0)