diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-06-07 14:53:20 +0200 |
---|---|---|
committer | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-07-20 11:17:34 +0200 |
commit | 174f4a4d6a8e54429732e01ea4448d2d08b2bf98 (patch) | |
tree | 495aed7b25ca3a2084170a1a2d274d571dcb3713 /util/check-format.pl | |
parent | check-format.pl: Add check for essentially empty line at beginning of file (diff) | |
download | openssl-174f4a4d6a8e54429732e01ea4448d2d08b2bf98.tar.xz openssl-174f4a4d6a8e54429732e01ea4448d2d08b2bf98.zip |
check-format.pl: Report empty lines only if -s (--sloppy-spc) is not used
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12270)
Diffstat (limited to 'util/check-format.pl')
-rwxr-xr-x | util/check-format.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util/check-format.pl b/util/check-format.pl index 2bbf7e7c54..0619240f82 100755 --- a/util/check-format.pl +++ b/util/check-format.pl @@ -1075,11 +1075,11 @@ while (<>) { # loop over all lines of all input files } if (m/^\s*$/) { # essentially empty line: just whitespace (and maybe a '\') - report("empty line at beginnig of file") if $line == 1; + report("empty line at beginnig of file") if $line == 1 && !$sloppy_SPC; } else { if ($line_before > 0) { my $linediff = $line - $line_before - 1; - report("$linediff empty lines before") if $linediff > 1; + report("$linediff empty lines before") if $linediff > 1 && !$sloppy_SPC; } $line_before2 = $line_before; $contents_before2 = $contents_before; @@ -1103,7 +1103,7 @@ while (<>) { # loop over all lines of all input files if (eof) { # check for essentially empty line (which may include a '\') just before EOF report(($1 eq "\n" ? "empty line" : $2 ne "" ? "'\\'" : "whitespace")." at EOF") - if $contents =~ m/^(\s*(\\?)\s*)$/; + if $contents =~ m/^(\s*(\\?)\s*)$/ && !$sloppy_SPC; # report unclosed expression-level nesting check_nested_nonblock_indents("expr at EOF"); # also adapts @nested_block_indents |