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:
Viktor Szakats 2025-11-14 17:55:33 +01:00
parent 8a968095df
commit 2dc71ba8bf
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
73 changed files with 146 additions and 144 deletions

View file

@ -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

View file

@ -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