Skip to content

Commit 46933bf

Browse files
jnavilagitster
authored andcommitted
lint-gitlink: preemptively ignore all /ifn?def|endif/ macros
Instead of testing if the macro name is ifn?def:: as if it were a inline macro, it is faster and safer to just ignore such block macro lines before hand. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ad228c2 commit 46933bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Documentation/lint-gitlink.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ sub report {
4141
@ARGV = $to_check;
4242
while (<>) {
4343
my $line = $_;
44+
next if $line =~ /^\s*(ifn?def|endif)::/;
4445
while ($line =~ m/(.{,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
4546
my $pos = pos $line;
4647
my ($macro, $target, $page, $section) = ($1, $2, $3, $4);
47-
if ( $macro ne "linkgit:" && $macro !~ "ifn?def::" && $macro ne "endif::" ) {
48+
if ( $macro ne "linkgit:" ) {
4849
report($pos, $line, $target, "linkgit: macro expected");
4950
}
5051
}

0 commit comments

Comments
 (0)