diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-05-29 19:09:28 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2019-05-30 12:40:24 -0400 |
commit | aeaacbfed853c17b8ac5e73c21f54d7f0805d899 (patch) | |
tree | 9bb95f8e02cb2f4f2d8aabe80cf74b47759c8500 /scripts/documentation-file-ref-check | |
parent | 9e78e7fc0b20bcc0d5599f71d297b6fa1a2e7c5f (diff) |
scripts/documentation-file-ref-check: exclude false-positives
There are at least two cases where a documentation file was gone
for good, but the text still mentions it:
1) drivers/vhost/vhost.c:
the reference for Documentation/virtual/lguest/lguest.c is just
to give credits to the original work that vhost replaced;
2) Documentation/scsi/scsi_mid_low_api.txt:
It gives credit and mentions the old Documentation/Configure.help
file that used to be part of Kernel 2.4.x
As we don't want to keep the script to keep pinpoint to those
every time, let's add a logic at the script to allow it to ignore
valid false-positives like the above.
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 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check index 6b622b88f4cf..05235775cc71 100755 --- a/scripts/documentation-file-ref-check +++ b/scripts/documentation-file-ref-check | |||
@@ -8,6 +8,14 @@ use warnings; | |||
8 | use strict; | 8 | use strict; |
9 | use Getopt::Long qw(:config no_auto_abbrev); | 9 | use Getopt::Long qw(:config no_auto_abbrev); |
10 | 10 | ||
11 | # NOTE: only add things here when the file was gone, but the text wants | ||
12 | # to mention a past documentation file, for example, to give credits for | ||
13 | # the original work. | ||
14 | my %false_positives = ( | ||
15 | "Documentation/scsi/scsi_mid_low_api.txt" => "Documentation/Configure.help", | ||
16 | "drivers/vhost/vhost.c" => "Documentation/virtual/lguest/lguest.c", | ||
17 | ); | ||
18 | |||
11 | my $scriptname = $0; | 19 | my $scriptname = $0; |
12 | $scriptname =~ s,.*/([^/]+/),$1,; | 20 | $scriptname =~ s,.*/([^/]+/),$1,; |
13 | 21 | ||
@@ -122,6 +130,11 @@ while (<IN>) { | |||
122 | next if (grep -e, glob("$path/$ref $path/$fulref")); | 130 | next if (grep -e, glob("$path/$ref $path/$fulref")); |
123 | } | 131 | } |
124 | 132 | ||
133 | # Discard known false-positives | ||
134 | if (defined($false_positives{$f})) { | ||
135 | next if ($false_positives{$f} eq $fulref); | ||
136 | } | ||
137 | |||
125 | if ($fix) { | 138 | if ($fix) { |
126 | if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) { | 139 | if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) { |
127 | $broken_ref{$ref}++; | 140 | $broken_ref{$ref}++; |