summaryrefslogtreecommitdiffstats
path: root/src/CheckBasicStyle.lua
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-05-09 09:25:09 +0200
committerMattes D <github@xoft.cz>2015-05-09 12:58:54 +0200
commitc13b1931ff26a5643c9fe68ab32b1e362cfacd70 (patch)
tree0c19db714a5dd08eb2775b39487e96cf317cf867 /src/CheckBasicStyle.lua
parentRabbit and cooked rabbit now stackable (diff)
downloadcuberite-c13b1931ff26a5643c9fe68ab32b1e362cfacd70.tar
cuberite-c13b1931ff26a5643c9fe68ab32b1e362cfacd70.tar.gz
cuberite-c13b1931ff26a5643c9fe68ab32b1e362cfacd70.tar.bz2
cuberite-c13b1931ff26a5643c9fe68ab32b1e362cfacd70.tar.lz
cuberite-c13b1931ff26a5643c9fe68ab32b1e362cfacd70.tar.xz
cuberite-c13b1931ff26a5643c9fe68ab32b1e362cfacd70.tar.zst
cuberite-c13b1931ff26a5643c9fe68ab32b1e362cfacd70.zip
Diffstat (limited to 'src/CheckBasicStyle.lua')
-rwxr-xr-xsrc/CheckBasicStyle.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/CheckBasicStyle.lua b/src/CheckBasicStyle.lua
index 8cd454e8f..09e64b954 100755
--- a/src/CheckBasicStyle.lua
+++ b/src/CheckBasicStyle.lua
@@ -149,6 +149,27 @@ local g_ViolationPatterns =
-- No space before a closing parenthesis:
{" %)", "Remove the space before \")\""},
+
+ -- 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 +"},
+ --[[
+ -- Cannot check these because of text such as "X+" and "+2" appearing in some comments.
+ {"^[a-zA-Z0-9]+ %+[a-zA-Z0-9]+", "Add space after +"},
+ {"[!@#$%%%^&*() %[%]\t][a-zA-Z0-9]+ %+[a-zA-Z0-9]+", "Add space after +"},
+ {"^[a-zA-Z0-9]+%+ [a-zA-Z0-9]+", "Add space before +"},
+ {"[!@#$%%%^&*() %[%]\t][a-zA-Z0-9]+%+ [a-zA-Z0-9]+", "Add space before +"},
+ --]]
+
+ -- Cannot check spaces around "-", because the minus is sometimes used as a hyphen between-words
+
+ -- 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 *"},
+
+ -- 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 /"},
}