aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/lint-gitlink.perl
diff options
context:
space:
mode:
authorJean-Noël Avila <jn.avila@free.fr>2025-08-11 20:53:15 +0000
committerJunio C Hamano <gitster@pobox.com>2025-08-11 14:16:03 -0700
commitf81a574f59a61dd85ee918f8759a624d33f3539e (patch)
tree40d128da8a735064992e69cc85c599394b4567a7 /Documentation/lint-gitlink.perl
parentGit 2.51-rc0 (diff)
downloadgit-f81a574f59a61dd85ee918f8759a624d33f3539e.tar.gz
git-f81a574f59a61dd85ee918f8759a624d33f3539e.zip
doc: test linkgit macros for well-formedness
Some readers of man pages have reported that they found malformed linkgit macros in the documentation (absence or bad spelling). Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/lint-gitlink.perl')
-rwxr-xr-xDocumentation/lint-gitlink.perl7
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/lint-gitlink.perl b/Documentation/lint-gitlink.perl
index aea564dad7..f183a18df2 100755
--- a/Documentation/lint-gitlink.perl
+++ b/Documentation/lint-gitlink.perl
@@ -41,6 +41,13 @@ die "BUG: No list of valid linkgit:* files given" unless @ARGV;
@ARGV = $to_check;
while (<>) {
my $line = $_;
+ 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::" ) {
+ report($pos, $line, $target, "linkgit: macro expected");
+ }
+ }
while ($line =~ m/linkgit:((.*?)\[(\d)\])/g) {
my $pos = pos $line;
my ($target, $page, $section) = ($1, $2, $3);