spacecheck.pl: verify tests/data/test* for non-ASCII chars

Exclude test data files (4 of them) based on existing feature tags:
`codeset-utf8` and `Unicode`.

Add the new keyword `non-ascii` to mark remaining exceptions (9 files).

Follow-up to 838dc53bb7 #17247

Closes #17329
This commit is contained in:
Viktor Szakats 2025-05-12 19:20:40 +02:00
parent fca1fdc988
commit 9243ed59b3
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
12 changed files with 15 additions and 2 deletions

View file

@ -69,7 +69,6 @@ my @non_ascii = (
"docs/THANKS",
"docs/THANKS-filter",
"tests/libtest/lib1560.c",
"^tests/data/test",
);
sub fn_match {
@ -162,7 +161,7 @@ while(my $filename = <$git_ls_files>) {
$content =~ s/[$non_ascii_allowed]//g;
if(!fn_match($filename, @non_ascii) &&
$content =~ /([\x80-\xff]+)/) {
($content =~ /([\x80-\xff]+)/ && $content !~ /^(codeset-utf8|Unicode|non-ascii)/m)) {
push @err, "content: has non-ASCII: '$1'";
}