diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/code-style.pl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/code-style.pl b/scripts/code-style.pl index 4e74f12f0..50d700543 100644 --- a/scripts/code-style.pl +++ b/scripts/code-style.pl @@ -121,11 +121,14 @@ while (<>) { $msg = "missing space before '{'"; } # there should be a space after ',' - elsif (/[,][^ ]/ && $program) { + elsif (/[,][^ \n\r]/ && $program) { $msg = "missing space after ','"; } # spaces before and after, only foreach may use $foo=>bar - elsif (/[^ =](\+|\-|\*|==|\.=|=>|=|\|\|)[^ =>]/ && $program && !/foreach/) { + elsif (/[^ =|-|\+](\+|\-)[^ =>|-|\+]/ && $program && !/foreach/) { + $msg = "'$1' -> ' $1 '"; + } + elsif (/[^ =](\*|==|\.=|=>|=|\|\|)[^ =>]/ && $program && !/foreach/) { $msg = "'$1' -> ' $1 '"; } # ensure $bar["foo"] and $bar[$foo] and $bar[0] |