tidy-up: miscellaneous

- drop stray duplicate empty lines in docs, scripts, test data, include,
  examples, tests.
- drop duplicate PP parenthesis.
- curl-functions.m4: move literals to the right side in if expressions,
  to match rest of the source code.
- FAQ.md: delete language designator from an URL.
- packages: apply clang-format (OS400, VMS).
- scripts/schemetable.c: apply clang-format.
- data320: delete duplicate empty line that doesn't change the outcome.
- spacecheck: extend to check for duplicate empty lines
  (with exceptions.)
- fix whitespace nits

Closes #19936
This commit is contained in:
Viktor Szakats 2025-12-07 16:49:55 +01:00
parent 141ce4be64
commit fe8393d7db
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
116 changed files with 674 additions and 1039 deletions

View file

@ -136,6 +136,5 @@ foreach my $v (keys %remove) {
}
}
# return the exit code from diff
exit system("diff -u /tmp/autotools /tmp/cmake") >> 8;

View file

@ -116,7 +116,6 @@ my %commonrc = (
'26' => 1,
);
sub runone {
my $a;
my $nargs = getnum(60) + 1;

View file

@ -39,6 +39,13 @@ my @need_crlf = (
"\\.(bat|sln)\$",
);
my @double_empty_lines = (
"^lib/.+\\.(c|h)\$",
"^packages/",
"^tests/data/test",
"\\.(m4|py)\$",
);
my @non_ascii_allowed = (
'\xC3\xB6', # UTF-8 for https://codepoints.net/U+00F6 LATIN SMALL LETTER O WITH DIAERESIS
);
@ -100,7 +107,7 @@ while(my $filename = <$git_ls_files>) {
my @err = ();
if(!fn_match($filename, @tabs) &&
$content =~ /\t/) {
$content =~ /\t/) {
push @err, "content: has tab";
}
@ -111,12 +118,12 @@ while(my $filename = <$git_ls_files>) {
}
if($eol ne "crlf" &&
fn_match($filename, @need_crlf)) {
fn_match($filename, @need_crlf)) {
push @err, "content: must use CRLF EOL for this file type";
}
if($eol ne "lf" && $content ne "" &&
!fn_match($filename, @need_crlf)) {
!fn_match($filename, @need_crlf)) {
push @err, "content: must use LF EOL for this file type";
}
@ -131,20 +138,27 @@ while(my $filename = <$git_ls_files>) {
}
if($content ne "" &&
$content !~ /\n\z/) {
$content !~ /\n\z/) {
push @err, "content: has no EOL at EOF";
}
if($content =~ /\n\n\z/ ||
$content =~ /\r\n\r\n\z/) {
$content =~ /\r\n\r\n\z/) {
push @err, "content: has multiple EOL at EOF";
}
if($content =~ /\n\n\n\n/ ||
$content =~ /\r\n\r\n\r\n\r\n/) {
$content =~ /\r\n\r\n\r\n\r\n/) {
push @err, "content: has 3 or more consecutive empty lines";
}
if(!fn_match($filename, @double_empty_lines)) {
if($content =~ /\n\n\n/ ||
$content =~ /\r\n\r\n\r\n/) {
push @err, "content: has 2 consecutive empty lines";
}
}
if($content =~ /([\x00-\x08\x0b\x0c\x0e-\x1f\x7f])/) {
push @err, "content: has binary contents";
}

View file

@ -39,7 +39,6 @@ sub testcompile {
return $rc;
}
sub extract {
my($f) = @_;
my $syn = 0;