From 31462d84bac89d0e86f06b1e3ebc11bb7e7990c1 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 19 Feb 2024 11:41:33 +0100 Subject: [PATCH] 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. --- tests/sanity/style.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sanity/style.test b/tests/sanity/style.test index 52ce2a2f2..dfe263031 100755 --- a/tests/sanity/style.test +++ b/tests/sanity/style.test @@ -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 &&