style: better support if statement with initializer

* tests/sanity/style.test: Here.
This commit is contained in:
Alexandre Duret-Lutz 2021-09-01 11:59:54 +02:00
parent 49b5d570e7
commit 200ee0d204

View file

@ -164,7 +164,7 @@ for dir in "$TOP/spot" "$TOP/bin" "$TOP/tests"; do
$GREP '[ ]if ([^()]*([^()]*)[^()]*).*;' $tmp &&
diag 'if body should be on another line.'
$GREP '[ ]else.*;' $tmp &&
$GREP -E '[ ]else.*;(|.*}.*)$' $tmp &&
diag 'else body should be on another line.'
$GREP '[ ]while(' $tmp &&