mirror of
https://github.com/postgres/postgres.git
synced 2025-08-12 15:23:02 +03:00
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
This commit is contained in:
@@ -18,7 +18,8 @@ use constant {
|
||||
NONE => 0,
|
||||
TO_UNICODE => 1,
|
||||
FROM_UNICODE => 2,
|
||||
BOTH => 3 };
|
||||
BOTH => 3
|
||||
};
|
||||
|
||||
#######################################################################
|
||||
# read_source - common routine to read source file
|
||||
@@ -56,7 +57,8 @@ sub read_source
|
||||
comment => $4,
|
||||
direction => BOTH,
|
||||
f => $fname,
|
||||
l => $. };
|
||||
l => $.
|
||||
};
|
||||
|
||||
# Ignore pure ASCII mappings. PostgreSQL character conversion code
|
||||
# never even passes these to the conversion code.
|
||||
@@ -370,9 +372,11 @@ sub print_radix_table
|
||||
}
|
||||
|
||||
unshift @segments,
|
||||
{ header => "Dummy map, for invalid values",
|
||||
{
|
||||
header => "Dummy map, for invalid values",
|
||||
min_idx => 0,
|
||||
max_idx => $widest_range };
|
||||
max_idx => $widest_range
|
||||
};
|
||||
|
||||
###
|
||||
### Eliminate overlapping zeros
|
||||
@@ -655,12 +659,14 @@ sub build_segments_recurse
|
||||
if ($level == $depth)
|
||||
{
|
||||
push @segments,
|
||||
{ header => $header . ", leaf: ${path}xx",
|
||||
{
|
||||
header => $header . ", leaf: ${path}xx",
|
||||
label => $label,
|
||||
level => $level,
|
||||
depth => $depth,
|
||||
path => $path,
|
||||
values => $map };
|
||||
values => $map
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -678,12 +684,14 @@ sub build_segments_recurse
|
||||
}
|
||||
|
||||
push @segments,
|
||||
{ header => $header . ", byte #$level: ${path}xx",
|
||||
{
|
||||
header => $header . ", byte #$level: ${path}xx",
|
||||
label => $label,
|
||||
level => $level,
|
||||
depth => $depth,
|
||||
path => $path,
|
||||
values => \%children };
|
||||
values => \%children
|
||||
};
|
||||
}
|
||||
return @segments;
|
||||
}
|
||||
@@ -776,7 +784,8 @@ sub make_charmap_combined
|
||||
code => $c->{code},
|
||||
comment => $c->{comment},
|
||||
f => $c->{f},
|
||||
l => $c->{l} };
|
||||
l => $c->{l}
|
||||
};
|
||||
push @combined, $entry;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user