badwords: fix issues found in scripts and other files

Single pass, not enforced.

Also:
- pyspelling.words: drop `web page`

Closes #19572
This commit is contained in:
Viktor Szakats
2025-11-17 16:06:00 +01:00
parent 42c43f695c
commit ad35ecba97
45 changed files with 104 additions and 105 deletions

View File

@@ -55,10 +55,10 @@ while(@ARGV) {
print <<HELP
Usage: cd2nroff [options] [file.md]
-d <dir> Write the output to the file name from the meta-data in the
-d <dir> Write the output to the filename from the meta-data in the
specified directory, instead of writing to stdout
-e <ext> If -d is used, this option can provide an added "extension", arbitrary
text really, to append to the file name.
text really, to append to the filename.
-h This help text,
-v Show version then exit
HELP
@@ -373,7 +373,7 @@ sub single {
my $blankline = 0;
my $header = 0;
# cut off the leading path from the file name, if any
# cut off the leading path from the filename, if any
$f =~ s/^(.*[\\\/])//;
push @desc, ".\\\" generated by cd2nroff $cd2nroff from $f\n";
@@ -515,7 +515,7 @@ sub single {
$blankline++;
}
else {
# don't output newlines if this is the first content after a
# do not output newlines if this is the first content after a
# header
push @desc, "\n" if($blankline && !$header);
$blankline = 0;

View File

@@ -23,7 +23,7 @@
#
###########################################################################
# provide all dir names to scan on the cmdline
# provide all directory names to scan on the command-line
use strict;
use warnings;

View File

@@ -181,7 +181,7 @@ sub readskiplist {
# Reads the .checksrc in $dir for any extended warnings to enable locally.
# Currently there is no support for disabling warnings from the standard set,
# and since that's already handled via !checksrc! commands there is probably
# and since that is already handled via !checksrc! commands there is probably
# little use to add it.
sub readlocalfile {
my ($file) = @_;
@@ -246,7 +246,7 @@ sub checkwarn {
my $nowarn=0;
#if(!$warnings{$name}) {
# print STDERR "Dev! there's no description for $name!\n";
# print STDERR "Dev! there is no description for $name!\n";
#}
# checksrc.skip
@@ -351,7 +351,7 @@ if(!$file) {
print " -A[rule] Accept this violation, can be used multiple times\n";
print " -a[func] Allow use of this function\n";
print " -b[func] Ban use of this function\n";
print " -D[DIR] Directory to prepend file names\n";
print " -D[DIR] Directory to prepend filenames\n";
print " -h Show help output\n";
print " -W[file] Skip the given file - ignore all its flaws\n";
print " -i<n> Indent spaces. Default: 2\n";
@@ -971,7 +971,7 @@ sub scanfile {
}
# check for open brace first on line but not first column only alert
# if previous line ended with a close paren and it wasn't a cpp line
# if previous line ended with a close paren and it was not a cpp line
if(($prevl =~ /\)\z/) && ($l =~ /^( +)\{/) && !$prevp) {
checkwarn("BRACEPOS",
$line, length($1), $file, $ol, "badly placed open brace");
@@ -995,7 +995,7 @@ sub scanfile {
}
# if the previous line starts with if/while/for AND ends with a closed
# parenthesis and there's an equal number of open and closed
# parenthesis and there is an equal number of open and closed
# parentheses, check that this line is indented $indent more steps, if
# not a cpp line
elsif(!$prevp && ($prevl =~ /^( *)(if|while|for)(\(.*\))\z/)) {

View File

@@ -182,7 +182,7 @@ for my $w (sort keys %avail) {
}
}
print "Never ENABLED configure options that aren't on by default\n";
print "Never ENABLED configure options that are not on by default\n";
for my $w (sort keys %avail) {
if(!$with{$w} && !$defaulton{$w}) {
printf " %s\n", $w;
@@ -190,7 +190,7 @@ for my $w (sort keys %avail) {
}
print "ENABLED configure options that aren't available\n";
print "ENABLED configure options that are not available\n";
for my $w (sort keys %with) {
if(!$avail{$w}) {
printf " %s\n", $w;

View File

@@ -34,7 +34,7 @@
# cmake-lint can be installed from PyPi with the command "python3 -m pip
# install cmakelang".
#
# The xargs invocation is portable, but does not preserve spaces in file names.
# The xargs invocation is portable, but does not preserve spaces in filenames.
# If such a file is ever added, then this can be portably fixed by switching to
# "xargs -I{}" and appending {} to the end of the xargs arguments (which will
# call cmakelint once per file) or by using the GNU extension "xargs -d'\n'".

View File

@@ -84,8 +84,8 @@ sub parse_main_opts {
@files = readdir($dir_handle);
closedir($dir_handle) || die "Unable to close handle on dir: $opts_dir due to error: $!";
# We want regular files that end with .md and don't start with an underscore
# Edge case: MANPAGE.md doesn't start with an underscore but also isn't documentation for an option
# We want regular files that end with .md and do not start with an underscore
# Edge case: MANPAGE.md does not start with an underscore but also is not documentation for an option
@files = grep { $_ =~ /\.md$/i && !/^_/ && -f "$opts_dir/$_" && $_ ne "MANPAGE.md" } @files;
for my $file (@files) {
@@ -145,8 +145,8 @@ sub parse_main_opts {
push(@list, $option);
}
# Sort longest first, because zsh won't complete an option listed
# after one that's a prefix of it. When length is equal, fall back
# Sort longest first, because zsh does not complete an option listed
# after one that is a prefix of it. When length is equal, fall back
# to stringwise cmp.
@list = sort {
$a =~ /([^=]*)/; my $ma = $1;

View File

@@ -538,7 +538,7 @@ sub render {
exit 3;
}
if($quote) {
# don't leave the quote "hanging"
# do not leave the quote "hanging"
push @desc, ".fi\n" if($manpage);
}
if($tablemode) {
@@ -1052,7 +1052,7 @@ sub sourcecategories {
my ($dir) = @_;
my %cats;
open(H, "<$dir/../../src/tool_help.h") ||
die "can't find the header file";
die "cannot find the header file";
while(<H>) {
if(/^\#define CURLHELP_([A-Z0-9]*)/) {
$cats{lc($1)}++;

View File

@@ -92,7 +92,7 @@ my @valid_mozilla_trust_purposes = (
my @valid_mozilla_trust_levels = (
"TRUSTED_DELEGATOR", # CAs
"NOT_TRUSTED", # Don't trust these certs.
"MUST_VERIFY_TRUST", # This explicitly tells us that it ISN'T a CA but is
"MUST_VERIFY_TRUST", # This explicitly tells us that it IS NOT a CA but is
# otherwise ok. In other words, this should tell the
# app to ignore any other sources that claim this is
# a CA.
@@ -154,7 +154,7 @@ sub warning_message() {
print " 2) Default to 'release', but more recent updates may be found in other trees\n";
print " 3) certdata.txt file format may change, lag time to update this script\n";
print " 4) Generally unwise to blindly trust CAs without manual review & verification\n";
print " 5) Mozilla apps use additional security checks aren't represented in certdata\n";
print " 5) Mozilla apps use additional security checks are not represented in certdata\n";
print " 6) Use of this script will make a security engineer grind his teeth and\n";
print " swear at you. ;)\n";
exit;
@@ -241,7 +241,7 @@ sub parse_csv_param($$@) {
sub sha256 {
my $result;
if($Digest::SHA::VERSION || $Digest::SHA::PurePerl::VERSION) {
open(FILE, $_[0]) or die "Can't open '$_[0]': $!";
open(FILE, $_[0]) or die "Could not open '$_[0]': $!";
binmode(FILE);
$result = $MOD_SHA->new(256)->addfile(*FILE)->hexdigest;
close(FILE);
@@ -401,9 +401,9 @@ my $currentdate = scalar gmtime($filedate);
my $format = $opt_t ? "plain text and " : "";
if($stdout) {
open(CRT, '> -') or die "Couldn't open STDOUT: $!\n";
open(CRT, '> -') or die "Could not open STDOUT: $!\n";
} else {
open(CRT,">$crt.~") or die "Couldn't open $crt.~: $!\n";
open(CRT,">$crt.~") or die "Could not open $crt.~: $!\n";
}
print CRT <<EOT;
##
@@ -442,7 +442,7 @@ my @precert;
my $cka_value;
my $valid = 0;
open(TXT,"$txt") or die "Couldn't open $txt: $!\n";
open(TXT,"$txt") or die "Could not open $txt: $!\n";
while(<TXT>) {
if(/\*\*\*\*\* BEGIN LICENSE BLOCK \*\*\*\*\*/) {
print CRT;
@@ -629,25 +629,25 @@ while(<TXT>) {
$pipe = "|$openssl x509 -" . $hash . " -fingerprint -noout -inform PEM";
if(!$stdout) {
$pipe .= " >> $crt.~";
close(CRT) or die "Couldn't close $crt.~: $!";
close(CRT) or die "Could not close $crt.~: $!";
}
open(TMP, $pipe) or die "Couldn't open openssl pipe: $!";
open(TMP, $pipe) or die "Could not open openssl pipe: $!";
print TMP $pem;
close(TMP) or die "Couldn't close openssl pipe: $!";
close(TMP) or die "Could not close openssl pipe: $!";
if(!$stdout) {
open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!";
open(CRT, ">>$crt.~") or die "Could not open $crt.~: $!";
}
}
$pipe = "|$openssl x509 -text -inform PEM";
if(!$stdout) {
$pipe .= " >> $crt.~";
close(CRT) or die "Couldn't close $crt.~: $!";
close(CRT) or die "Could not close $crt.~: $!";
}
open(TMP, $pipe) or die "Couldn't open openssl pipe: $!";
open(TMP, $pipe) or die "Could not open openssl pipe: $!";
print TMP $pem;
close(TMP) or die "Couldn't close openssl pipe: $!";
close(TMP) or die "Could not close openssl pipe: $!";
if(!$stdout) {
open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!";
open(CRT, ">>$crt.~") or die "Could not open $crt.~: $!";
}
}
report "Processed: $caname" if($opt_v);
@@ -655,8 +655,8 @@ while(<TXT>) {
}
}
}
close(TXT) or die "Couldn't close $txt: $!\n";
close(CRT) or die "Couldn't close $crt.~: $!\n";
close(TXT) or die "Could not close $txt: $!\n";
close(CRT) or die "Could not close $crt.~: $!\n";
unless($stdout) {
if($opt_b && -e $crt) {
my $bk = 1;

View File

@@ -23,7 +23,7 @@
#
###########################################################################
# The xargs invocation is portable, but does not preserve spaces in file names.
# The xargs invocation is portable, but does not preserve spaces in filenames.
# If such a file is ever added, then this can be portably fixed by switching to
# "xargs -I{}" and appending {} to the end of the xargs arguments (which will
# call cmakelint once per file) or by using the GNU extension "xargs -d'\n'".

View File

@@ -31,10 +31,10 @@
#
# $ ./scripts/release-notes.pl
#
# 2. Edit RELEASE-NOTES and remove all entries that don't belong. Unused
# 2. Edit RELEASE-NOTES and remove all entries that do not belong. Unused
# references below will be cleaned up in the next step. Make sure to move
# "changes" up to the changes section. All entries will by default be listed
# under bug-fixes as this script can't know where to put them.
# under bug-fixes as this script cannot know where to put them.
#
# 3. Run the cleanup script and let it sort the entries and remove unused
# references from lines you removed in step (2):

View File

@@ -31,7 +31,7 @@ version=${2:-unknown}
tag=$(echo "curl-$version" | tr '.' '_')
commit=${3}
if [ -n "$commit" ] && [ -r "docs/tarball-commit.txt.dist" ]; then
# If commit is given, then the tag likely doesn't actually exist
# If commit is given, then the tag likely does not actually exist
tag="$(cat docs/tarball-commit.txt.dist)"
fi

View File

@@ -64,7 +64,7 @@ open(F, "git ls-files '*.c'|");
while(<F>) {
chomp $_;
my $file = $_;
# we can't filter these with git so do it here
# we cannot filter these with git so do it here
if($file =~ /^(lib|src)/) {
push @files, $file;
}