mirror of
https://github.com/git-for-windows/git.git
synced 2026-02-03 18:59:59 -06:00
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>
This commit is contained in:
parent
ad228c24df
commit
46933bf182
@ -41,10 +41,11 @@ die "BUG: No list of valid linkgit:* files given" unless @ARGV;
|
||||
@ARGV = $to_check;
|
||||
while (<>) {
|
||||
my $line = $_;
|
||||
next if $line =~ /^\s*(ifn?def|endif)::/;
|
||||
while ($line =~ m/(.{,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
|
||||
my $pos = pos $line;
|
||||
my ($macro, $target, $page, $section) = ($1, $2, $3, $4);
|
||||
if ( $macro ne "linkgit:" && $macro !~ "ifn?def::" && $macro ne "endif::" ) {
|
||||
if ( $macro ne "linkgit:" ) {
|
||||
report($pos, $line, $target, "linkgit: macro expected");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user