← Commit list

e52e6dac8e

Viktor Szakats
Viktor Szakats
2026-01-12
SUCCESS Duration: 342s

Subject

spacecheck: show line numbers of duplicate empty lines

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

scripts/spacecheck.pl+16 -6
@@ -147,15 +147,25 @@ while(my $filename = <$git_ls_files>) {
push @err, "content: has multiple EOL at EOF";
}
- if($content =~ /\n\n\n\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";
+ my $line = 0;
+ my $blank = 0;
+ for my $l (split(/\n/, $content)) {
+ chomp $l;
+ $line++;
+ if($l =~ /^$/) {
+ if($blank) {
+ my $lineno = sprintf("duplicate empty line @ line %d", $line);
+ push @err, $lineno;
+ }
+ $blank = 1;
+ }
+ else {
+ $blank = 0;
+ }
+ }
}
}