From 66e8190ca801b78b66c29030e4ace783582b4ec8 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 8 Oct 2015 16:16:53 +0200 Subject: StyleCheck: Check spaces around ==, <=, >= --- src/CheckBasicStyle.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/CheckBasicStyle.lua') diff --git a/src/CheckBasicStyle.lua b/src/CheckBasicStyle.lua index f9f8f6b4d..a3d21106a 100755 --- a/src/CheckBasicStyle.lua +++ b/src/CheckBasicStyle.lua @@ -187,11 +187,19 @@ local g_ViolationPatterns = {"^[^\"]*[!@#$%%%^&*() %[%]\t][a-zA-Z0-9]+%/[a-zA-Z0-9]+", "Add space around /"}, -- Check spaces around "&": - {"^[a-zA-Z0-9]+%&[a-zA-Z0-9]+", "Add space around /"}, - {"^[^\"]*[!@#$%%%^&*() %[%]\t][a-zA-Z0-9]+%&[a-zA-Z0-9]+", "Add space around /"}, + {"^[a-zA-Z0-9]+%&[a-zA-Z0-9]+", "Add space around &"}, + {"^[^\"]*[!@#$%%%^&*() %[%]\t][a-zA-Z0-9]+%&[a-zA-Z0-9]+", "Add space around &"}, {"^[a-zA-Z0-9]+%& [a-zA-Z0-9]+", "Add space before &"}, {"^[^\"]*[!@#$%%%^&*() %[%]\t][a-zA-Z0-9]+%& [a-zA-Z0-9]+", "Add space before &"}, + -- Check spaces around "==", "<=" and ">=": + {"==[a-zA-Z0-9]+", "Add space after =="}, + {"[a-zA-Z0-9]+==", "Add space before =="}, + {"<=[a-zA-Z0-9]+", "Add space after <="}, + {"[a-zA-Z0-9]+<=", "Add space before <="}, + {">=[a-zA-Z0-9]+", "Add space after >="}, + {"[a-zA-Z0-9]+>=", "Add space before >="}, + -- 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 *'"}, -- cgit v1.2.3