Skip to content

Commit 1e633cb

Browse files
committed
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 <[email protected]>
1 parent 0e8243a commit 1e633cb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Documentation/gitweb.conf.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ $export_ok::
178178
Show repository only if this file exists (in repository). Only
179179
effective if this variable evaluates to true. Can be set when
180180
building gitweb by setting `GITWEB_EXPORT_OK`. This path is
181-
relative to `GIT_DIR`. git-daemon[1] uses 'git-daemon-export-ok',
181+
relative to `GIT_DIR`. linkgit:git-daemon[1] uses 'git-daemon-export-ok',
182182
unless started with `--export-all`. By default this variable is
183183
not set, which means that this feature is turned off.
184184

Documentation/lint-gitlink.perl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ sub report {
4141
@ARGV = $to_check;
4242
while (<>) {
4343
my $line = $_;
44+
while ($line =~ m/(.{,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
45+
my $pos = pos $line;
46+
my ($macro, $target, $page, $section) = ($1, $2, $3, $4);
47+
if ( $macro ne "linkgit:" && $macro !~ "ifn?def::" && $macro ne "endif::" ) {
48+
report($pos, $line, $target, "linkgit: macro expected");
49+
}
50+
}
4451
while ($line =~ m/linkgit:((.*?)\[(\d)\])/g) {
4552
my $pos = pos $line;
4653
my ($target, $page, $section) = ($1, $2, $3);

0 commit comments

Comments
 (0)