From 502b5ec73222efaadd5ca6dc3e2011b740162b29 Mon Sep 17 00:00:00 2001 From: mohe2015 Date: Thu, 20 Oct 2016 19:09:18 +0200 Subject: StyleCheck: Add "else has to be on a separate line" (#3412) --- src/CheckBasicStyle.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/CheckBasicStyle.lua') diff --git a/src/CheckBasicStyle.lua b/src/CheckBasicStyle.lua index 8d188bb67..6cd499fd1 100755 --- a/src/CheckBasicStyle.lua +++ b/src/CheckBasicStyle.lua @@ -203,6 +203,10 @@ local g_ViolationPatterns = -- We don't like "Type const *" and "Type const &". Use "const Type *" and "const Type &" instead: {"const %&", "Use 'const Type &' instead of 'Type const &'"}, {"const %*", "Use 'const Type *' instead of 'Type const *'"}, + + -- Check if "else" is on the same line as a brace. + {"}%s*else", "else has to be on a separate line"}, + {"else%s*{", "else has to be on a separate line"}, } -- cgit v1.2.3