diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-04-09 17:02:50 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-10 23:36:34 -0700 |
commit | 414abf159f9137ea9e4239f3c34d91310edc817d (patch) | |
tree | a4a56d24453fe6255b44af0fd98d3aa536c037cd /Documentation/lint-man-section-order.perl | |
parent | ea8b9271b17e64502dc80981cf09cec42739dce7 (diff) | |
download | git-414abf159f9137ea9e4239f3c34d91310edc817d.tar.gz |
docs: fix linting issues due to incorrect relative section order
Re-order the sections of a few manual pages to be consistent with the
entirety of the rest of our documentation. This allows us to remove
the just-added whitelist of "bad" order from
lint-man-section-order.perl.
I'm doing that this way around so that code will be easy to dig up if
we'll need it in the future. I've intentionally not added some other
sections such as EXAMPLES to the list of known sections.
If we were to add that we'd find some out of order. Perhaps we'll want
to order those consistently as well in the future, at which point
whitelisting some of them might become handy again.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/lint-man-section-order.perl')
-rwxr-xr-x | Documentation/lint-man-section-order.perl | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/Documentation/lint-man-section-order.perl b/Documentation/lint-man-section-order.perl index 5767e7e456..b05f9156dd 100755 --- a/Documentation/lint-man-section-order.perl +++ b/Documentation/lint-man-section-order.perl @@ -18,24 +18,13 @@ my %SECTIONS; 'DESCRIPTION' => { required => 1, order => $order++, - bad => { - 'git-mktag.txt' => 'OPTIONS', - 'git-cvsserver.txt' => 'OPTIONS', - }, }, 'OPTIONS' => { order => $order++, required => 0, - bad => { - 'git-grep.txt' => 'CONFIGURATION', - 'git-rebase.txt' => 'CONFIGURATION', - }, }, 'CONFIGURATION' => { order => $order++, - bad => { - 'git-svn.txt' => 'BUGS', - }, }, 'BUGS' => { order => $order++, @@ -77,16 +66,7 @@ while (my $line = <>) { my $expected_last = $expected_order[-2]; my $actual_last = $actual_order[-2]; - my $except_last = $SECTIONS{$line}->{bad}->{$ARGV} || ''; - if (($SECTIONS{$line}->{bad}->{$ARGV} || '') eq $actual_last) { - # Either we're whitelisted, or ... - next - } elsif (exists $SECTIONS{$actual_last}->{bad}->{$ARGV}) { - # ... we're complaing about the next section - # which is out of order because this one is, - # don't complain about that one. - next; - } elsif ($actual_last ne $expected_last) { + if ($actual_last ne $expected_last) { report("section '$line' incorrectly ordered, comes after '$actual_last'"); } next; |