Revert "extras: reverse test for '}' vs. following 'else' placement"

This reverts commit 0a8371bdfd.

Change-Id: I946f449ad213cea70fbbd9cd3951f5838b9f82e5
BUG: 1120646
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8927
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Harshavardhana 2014-10-13 15:19:35 -07:00 committed by Niels de Vos
parent 3b5b5042ec
commit 7808d4b789

View File

@ -3335,12 +3335,12 @@ sub process {
"trailing statements should be on next line\n" . $herecurr); "trailing statements should be on next line\n" . $herecurr);
} }
# Check for "} else" which is less readable. Having if/else keywords # Check for }<nl>else {, these must be at the same
# line up is a good thing, and having control structures on the same # indent level to be relevant to each other.
# line as a close-brace is bad. if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ and
if ($line=~/^.\s*}\selse\s*/) { $previndent == $indent) {
ERROR("ELSE_AFTER_BRACE", ERROR("ELSE_AFTER_BRACE",
"'}' and 'else' should be on separate lines\n" . $hereprev); "else should follow close brace '}'\n" . $hereprev);
} }
if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ and if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ and