style: relax the else's body check

* tests/sanity/style.test: Skip the "else body should be on next line"
check when else is followed by if.
This commit is contained in:
Alexandre Duret-Lutz 2024-02-19 11:41:33 +01:00
parent bcfcea6272
commit 31462d84ba

View file

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