mirror of
https://github.com/curl/curl.git
synced 2026-07-26 09:27:21 +03:00
spacecheck.pl: fix to check 3+ newlines in all files
Follow-up to e52e6dac8e #20269
Closes #21237
This commit is contained in:
parent
e078485b36
commit
7b96563a05
2 changed files with 20 additions and 4 deletions
|
|
@ -199,6 +199,26 @@ while(my $filename = <$git_ls_files>) {
|
|||
}
|
||||
}
|
||||
|
||||
if($content =~ /\n\n\n\n/ ||
|
||||
$content =~ /\r\n\r\n\r\n\r\n/) {
|
||||
my $line = 0;
|
||||
my $blank = 0;
|
||||
for my $l (split(/\n/, $content)) {
|
||||
chomp $l;
|
||||
$line++;
|
||||
if($l =~ /^$/) {
|
||||
if($blank > 1) {
|
||||
my $lineno = sprintf('3 or more consecutive empty lines @ line %d', $line);
|
||||
push @err, $lineno;
|
||||
}
|
||||
$blank++;
|
||||
}
|
||||
else {
|
||||
$blank = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!fn_match($filename, @longline)) {
|
||||
my $line = 0;
|
||||
for my $l (split(/\n/, $content)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue