mirror of
https://github.com/curl/curl.git
synced 2026-04-15 07:01:44 +03:00
badwords: check indented lines in source code, fix fallouts
- badwords.pl: add `-a` option to check all lines in source code files. Before this patch indented lines were skipped (to avoid Markdown code fences.) - GHA/checksrc: use `-a` when verifying the source code. - GHA/checksrc: disable `So` and `But` rules for source code. - GHA/checksrc: add docs/examples to the verified sources. - badwords.txt: delete 4 duplicates. - badwords.txt: group and sort contractions. - badwords.txt: allow ` url = `, `DIR`, `<file name`. Closes #19536
This commit is contained in:
parent
8a968095df
commit
2dc71ba8bf
73 changed files with 146 additions and 144 deletions
7
.github/scripts/badwords.pl
vendored
7
.github/scripts/badwords.pl
vendored
|
|
@ -20,7 +20,12 @@ use warnings;
|
|||
my @whitelist;
|
||||
my %alt;
|
||||
my %exactcase;
|
||||
my $skip_indented = 1;
|
||||
|
||||
if($ARGV[0] eq "-a") {
|
||||
shift @ARGV;
|
||||
$skip_indented = 0;
|
||||
}
|
||||
my %wl;
|
||||
if($ARGV[0] eq "-w") {
|
||||
shift @ARGV;
|
||||
|
|
@ -68,7 +73,7 @@ sub file {
|
|||
my $in = $_;
|
||||
$l++;
|
||||
chomp $in;
|
||||
if($in =~ /^ /) {
|
||||
if($skip_indented && $in =~ /^ /) {
|
||||
next;
|
||||
}
|
||||
# remove the link part
|
||||
|
|
|
|||
55
.github/scripts/badwords.txt
vendored
55
.github/scripts/badwords.txt
vendored
|
|
@ -10,59 +10,56 @@ tool chain:toolchain
|
|||
tool-chain:toolchain
|
||||
wild-card:wildcard
|
||||
wild card:wildcard
|
||||
\bit's:it is
|
||||
aren't:are not
|
||||
can't:cannot
|
||||
could've:could have
|
||||
couldn't:could not
|
||||
didn't:did not
|
||||
doesn't:does not
|
||||
don't=do not
|
||||
i'm:I am
|
||||
you've:You have
|
||||
we've:we have
|
||||
we're:we are
|
||||
we'll:we will
|
||||
we'd:we would
|
||||
they've:They have
|
||||
they're:They are
|
||||
they'll:They will
|
||||
isn't:is not
|
||||
it'd:it would
|
||||
should've:should have
|
||||
that's:that is
|
||||
there's:there is
|
||||
they'd:They would
|
||||
you've:you have
|
||||
they'll:They will
|
||||
they're:They are
|
||||
they've:They have
|
||||
we'd:we would
|
||||
we'll:we will
|
||||
we're:we are
|
||||
we've:we have
|
||||
won't:will not
|
||||
you'd:you would
|
||||
you'll:you will
|
||||
you're:you are
|
||||
should've:should have
|
||||
don't=do not
|
||||
could've:could have
|
||||
doesn't:does not
|
||||
isn't:is not
|
||||
aren't:are not
|
||||
you've:you have
|
||||
a html: an html
|
||||
a http: an http
|
||||
a ftp: an ftp
|
||||
a IPv4: an IPv4
|
||||
a IPv6: an IPv6
|
||||
url =URL
|
||||
url [^=]=URL
|
||||
[^/]internet\b=Internet
|
||||
isation:ization
|
||||
\bit's:it is
|
||||
it'd:it would
|
||||
there's:there is
|
||||
[^.]\. And: Rewrite it somehow?
|
||||
^(And|So|But) = Rewrite it somehow?
|
||||
\. But: Rewrite it somehow?
|
||||
\. So : Rewrite without "so" ?
|
||||
dir [^=]:directory
|
||||
dir [^=]=directory
|
||||
Dir [^=]=Directory
|
||||
sub-director:subdirector
|
||||
you'd:you would
|
||||
you'll:you will
|
||||
can't:cannot
|
||||
that's:that is
|
||||
web page:webpage
|
||||
host name\b:hostname
|
||||
host names\b:hostnames
|
||||
[^;]file name\b:filename
|
||||
[^;<]file name\b:filename
|
||||
file names\b:filenames
|
||||
\buser name\b:username
|
||||
\buser names\b:usernames
|
||||
\bpass phrase:passphrase
|
||||
didn't:did not
|
||||
doesn't:does not
|
||||
won't:will not
|
||||
couldn't:could not
|
||||
\bwill\b:rewrite to present tense
|
||||
\b32bit=32-bit
|
||||
\b64bit=64-bit
|
||||
|
|
|
|||
5
.github/workflows/checksrc.yml
vendored
5
.github/workflows/checksrc.yml
vendored
|
|
@ -174,6 +174,7 @@ jobs:
|
|||
- name: 'yamlcheck'
|
||||
run: .github/scripts/yamlcheck.sh
|
||||
|
||||
# we allow some extra in source code
|
||||
- name: 'badwords'
|
||||
run: grep -Ev '(\\bwill)' .github/scripts/badwords.txt | .github/scripts/badwords.pl src lib include
|
||||
run: |
|
||||
# we allow some extra in source code
|
||||
grep -Ev '(\\bwill| But: | So : )' .github/scripts/badwords.txt | .github/scripts/badwords.pl -a src lib include docs/examples
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue