mirror of
https://github.com/curl/curl.git
synced 2026-04-28 07:02:11 +03:00
badwords: check FAQ with allowlisted 'will', fix a typo
Also: - badwords.pl: add support for filename:word exceptions. - badwords.pl: handle `-w` file open errors. Ref: https://github.com/curl/curl/pull/19817#issuecomment-3612386568 Closes #19837
This commit is contained in:
parent
d517efe5bd
commit
7a1e99eefa
4 changed files with 18 additions and 5 deletions
7
.github/scripts/badwords.ok
vendored
Normal file
7
.github/scripts/badwords.ok
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
# whitelisted uses of bad words
|
||||
# file:[line]:rule
|
||||
docs/FAQ::\bwill\b
|
||||
12
.github/scripts/badwords.pl
vendored
12
.github/scripts/badwords.pl
vendored
|
|
@ -30,13 +30,13 @@ my %wl;
|
|||
if($ARGV[0] eq "-w") {
|
||||
shift @ARGV;
|
||||
my $file = shift @ARGV;
|
||||
open(W, "<$file");
|
||||
open(W, "<$file") or die "Cannot open '$file': $!";
|
||||
while(<W>) {
|
||||
if(/^#/) {
|
||||
# allow #-comments
|
||||
next;
|
||||
}
|
||||
if(/^([^:]*):(\d+):(.*)/) {
|
||||
if(/^([^:]*):(\d*):(.*)/) {
|
||||
$wl{"$1:$2:$3"}=1;
|
||||
#print STDERR "whitelisted $1:$2:$3\n";
|
||||
}
|
||||
|
|
@ -93,7 +93,13 @@ sub file {
|
|||
|
||||
my $ch = "$f:$l:$w";
|
||||
if($wl{$ch}) {
|
||||
# whitelisted
|
||||
# whitelisted filename + line + word
|
||||
print STDERR "$ch found but whitelisted\n";
|
||||
next;
|
||||
}
|
||||
$ch = $f . "::" . $w;
|
||||
if($wl{$ch}) {
|
||||
# whitelisted filename + word
|
||||
print STDERR "$ch found but whitelisted\n";
|
||||
next;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue