summaryrefslogtreecommitdiffstats
path: root/src/CheckBasicStyle.lua
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-10-08 18:46:27 +0200
committerMattes D <github@xoft.cz>2015-10-08 18:46:27 +0200
commit5d376bae1cae4da24a6a58a2438174b564d16187 (patch)
treee02c28ec25b98a8db58ec8e3aaf95263d0c168d1 /src/CheckBasicStyle.lua
parentMerge pull request #2533 from cuberite/LuaTLSClientCertFix (diff)
parentStyleCheck: Check spaces around ==, <=, >= (diff)
downloadcuberite-5d376bae1cae4da24a6a58a2438174b564d16187.tar
cuberite-5d376bae1cae4da24a6a58a2438174b564d16187.tar.gz
cuberite-5d376bae1cae4da24a6a58a2438174b564d16187.tar.bz2
cuberite-5d376bae1cae4da24a6a58a2438174b564d16187.tar.lz
cuberite-5d376bae1cae4da24a6a58a2438174b564d16187.tar.xz
cuberite-5d376bae1cae4da24a6a58a2438174b564d16187.tar.zst
cuberite-5d376bae1cae4da24a6a58a2438174b564d16187.zip
Diffstat (limited to 'src/CheckBasicStyle.lua')
-rwxr-xr-xsrc/CheckBasicStyle.lua12
1 files changed, 10 insertions, 2 deletions
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 *'"},