GHA: make the spacecheck say line number for trailing space errors

As it can be quite confusing and frustrating without it.

Closes #17777
This commit is contained in:
Daniel Stenberg 2025-06-29 14:48:05 +02:00
parent ff15eef2d6
commit a3272c526c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -131,8 +131,14 @@ while(my $filename = <$git_ls_files>) {
}
if(!fn_match($filename, @space_at_eol) &&
$content =~ /[ \t]\n/) {
push @err, "content: has line-ending whitespace";
$content =~ /[ \t]\n/) {
my $line;
for my $l (split(/\n/, $content)) {
$line++;
if($l =~ /[ \t]$/) {
push @err, "line $line: trailing whitespace";
}
}
}
if($content ne "" &&