From d4a06862cb4f064891bbe39dbfc06c0b47255f8c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 9 Mar 2026 20:36:01 +0100 Subject: [PATCH] spacecheck: find double newlines in `tests/data/test*` Closes #20872 --- scripts/spacecheck.pl | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/spacecheck.pl b/scripts/spacecheck.pl index ff8d866198..ff498c5a85 100755 --- a/scripts/spacecheck.pl +++ b/scripts/spacecheck.pl @@ -148,24 +148,24 @@ while(my $filename = <$git_ls_files>) { push @err, "content: has multiple EOL at EOF"; } - if(!fn_match($filename, @double_empty_lines)) { - if($content =~ /\n\n\n/ || - $content =~ /\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) { - my $lineno = sprintf("duplicate empty line @ line %d", $line); - push @err, $lineno; - } - $blank = 1; - } - else { - $blank = 0; + if((!fn_match($filename, @double_empty_lines) && + ($content =~ /\n\n\n/ || + $content =~ /\r\n\r\n\r\n/)) || + $content =~ />\n\n\n+[<#]/) { + 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; } } }