mirror of https://github.com/openssl/openssl.git
check-format.pl: Fix report on space before ';' and allow it after ')'
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17434)
This commit is contained in:
parent
d45c0e1a5e
commit
c30bc4e209
|
@ -70,6 +70,8 @@ int f(void) /*
|
||||||
;
|
;
|
||||||
for (i = 0; i < 1;)
|
for (i = 0; i < 1;)
|
||||||
;
|
;
|
||||||
|
for (;;) ; /* should not trigger: space before ';' */
|
||||||
|
lab: ; /* should not trigger: space before ';' */
|
||||||
|
|
||||||
#if X
|
#if X
|
||||||
if (1) /* bad style: just part of control structure depends on #if */
|
if (1) /* bad style: just part of control structure depends on #if */
|
||||||
|
|
|
@ -684,7 +684,7 @@ while (<>) { # loop over all lines of all input files
|
||||||
report("space before '$1'") if $intra_line =~ m/\s(\.|->)/; # '.' or '->' with preceding space
|
report("space before '$1'") if $intra_line =~ m/\s(\.|->)/; # '.' or '->' with preceding space
|
||||||
report("space after '$1'") if $intra_line =~ m/(\.|->)\s/; # '.' or '->' with following space
|
report("space after '$1'") if $intra_line =~ m/(\.|->)\s/; # '.' or '->' with following space
|
||||||
$intra_line =~ s/\-\>|\+\+|\-\-/@/g; # blind '->,', '++', and '--'
|
$intra_line =~ s/\-\>|\+\+|\-\-/@/g; # blind '->,', '++', and '--'
|
||||||
report("space before '$2'") if $intra_line =~ m/[^:]\s+(;)/; # space before ';' but not after ':'
|
report("space before '$1'") if $intra_line =~ m/[^:)]\s+(;)/; # space before ';' but not after ':' or ')'
|
||||||
report("space before '$1'") if $intra_line =~ m/\s([,)\]])/; # space before ,)]
|
report("space before '$1'") if $intra_line =~ m/\s([,)\]])/; # space before ,)]
|
||||||
report("space after '$1'") if $intra_line =~ m/([(\[~!])\s/; # space after ([~!
|
report("space after '$1'") if $intra_line =~ m/([(\[~!])\s/; # space after ([~!
|
||||||
report("space after '$1'") if $intra_line =~ m/(defined)\s/; # space after 'defined'
|
report("space after '$1'") if $intra_line =~ m/(defined)\s/; # space after 'defined'
|
||||||
|
|
Loading…
Reference in New Issue