summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-07-21 15:20:27 +0200
committermadmaxoft <github@xoft.cz>2014-07-21 17:40:43 +0200
commitfe6a3b5d7229ae07b536afa794fdb5bedbeb37e4 (patch)
tree316405380673ffc45aca85b2a3bce0d59f930d9b /src
parentStyle: Normalized to no spaces before closing parenthesis. (diff)
downloadcuberite-fe6a3b5d7229ae07b536afa794fdb5bedbeb37e4.tar
cuberite-fe6a3b5d7229ae07b536afa794fdb5bedbeb37e4.tar.gz
cuberite-fe6a3b5d7229ae07b536afa794fdb5bedbeb37e4.tar.bz2
cuberite-fe6a3b5d7229ae07b536afa794fdb5bedbeb37e4.tar.lz
cuberite-fe6a3b5d7229ae07b536afa794fdb5bedbeb37e4.tar.xz
cuberite-fe6a3b5d7229ae07b536afa794fdb5bedbeb37e4.tar.zst
cuberite-fe6a3b5d7229ae07b536afa794fdb5bedbeb37e4.zip
Diffstat (limited to 'src')
-rw-r--r--src/CheckBasicStyle.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/CheckBasicStyle.lua b/src/CheckBasicStyle.lua
index e4597a426..ddc552fa4 100644
--- a/src/CheckBasicStyle.lua
+++ b/src/CheckBasicStyle.lua
@@ -8,7 +8,7 @@ Checks that all source files (*.cpp, *.h) use the basic style requirements of th
- Two spaces between code and line-end comment ("//")
- Spaces after comma, not before
- Opening braces not at the end of a code line
- - (TODO) Spaces after if, for, while
+ - Spaces after if, for, while
- (TODO) Spaces before *, /, &
- (TODO) Hex numbers with even digit length
- (TODO) Hex numbers in lowercase
@@ -125,6 +125,21 @@ local g_ViolationPatterns =
-- Check that opening braces are not at the end of a code line:
{"[^%s].-{\n?$", "Brace should be on a separate line"},
+
+ -- Space after keywords:
+ {"[^_]if%(", "Needs a space after \"if\""},
+ {"for%(", "Needs a space after \"for\""},
+ {"while%(", "Needs a space after \"while\""},
+ {"switch%(", "Needs a space after \"switch\""},
+
+ -- No space after keyword's parenthesis:
+ {"[^%a#]if %( ", "Remove the space after \"(\""},
+ {"for %( ", "Remove the space after \"(\""},
+ {"while %( ", "Remove the space after \"(\""},
+ {"switch %( ", "Remove the space after \"(\""},
+
+ -- No space before a closing parenthesis:
+ {" %)", "Remove the space before \")\""},
}