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