diff options
author | Mauro Carvalho Chehab | 2019-06-04 09:26:27 -0300 |
---|---|---|
committer | Jonathan Corbet | 2019-06-07 11:33:16 -0600 |
commit | b1663d7e3a7961fc45262fd68a89253f2803036c (patch) | |
tree | e7e424e2d6bf9b53d846db99d421c19ffb1042ec /scripts/documentation-file-ref-check | |
parent | 3f9564e680efb2092dfb826e2f768920c9eb203b (diff) |
docs: Kbuild/Makefile: allow check for missing docs at build time
While this doesn't make sense for production Kernels, in order to
avoid regressions when documents are touched, let's add a
check target at the make file.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/documentation-file-ref-check')
-rwxr-xr-x | scripts/documentation-file-ref-check | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check index ff16db269079..440227bb55a9 100755 --- a/scripts/documentation-file-ref-check +++ b/scripts/documentation-file-ref-check @@ -22,9 +22,16 @@ $scriptname =~ s,.*/([^/]+/),$1,; # Parse arguments my $help = 0; my $fix = 0; +my $warn = 0; + +if (! -d ".git") { + printf "Warning: can't check if file exists, as this is not a git tree"; + exit 0; +} GetOptions( 'fix' => \$fix, + 'warn' => \$warn, 'h|help|usage' => \$help, ); @@ -139,6 +146,8 @@ while (<IN>) { if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) { $broken_ref{$ref}++; } + } elsif ($warn) { + print STDERR "Warning: $f references a file that doesn't exist: $fulref\n"; } else { print STDERR "$f: $fulref\n"; } |