aboutsummaryrefslogtreecommitdiff
path: root/clint.py
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-05-01 19:42:42 +0300
committerZyX <kp-pav@yandex.ru>2016-05-01 19:42:42 +0300
commita1f985f60a228604970a70872b7ea1fb5299eba3 (patch)
tree3dff2b787c3bc9ee4ffe90ca21e10e23622ea74f /clint.py
parent91afb30b667bbc321d351708f694d00b256be585 (diff)
downloadrneovim-a1f985f60a228604970a70872b7ea1fb5299eba3.tar.gz
rneovim-a1f985f60a228604970a70872b7ea1fb5299eba3.tar.bz2
rneovim-a1f985f60a228604970a70872b7ea1fb5299eba3.zip
clint: Check that boolean operator is placed on the next line
I have not found in the style guide words about other operators, so they are not tested. This adds 128 new errors.
Diffstat (limited to 'clint.py')
-rwxr-xr-xclint.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/clint.py b/clint.py
index d7aa866e35..c19ba4b7ae 100755
--- a/clint.py
+++ b/clint.py
@@ -2305,6 +2305,13 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
if match:
error(filename, linenum, 'whitespace/operators', 3,
'Missing spaces around %s' % match.group(1))
+
+ # Boolean operators should be placed on the next line.
+ if Search(r'(?:&&|\|\|)$', line):
+ error(filename, linenum, 'whitespace/operators', 4,
+ 'Boolean operator should be placed on the same line as the start '
+ 'of its right operand')
+
# We allow no-spaces around << when used like this: 10<<20, but
# not otherwise (particularly, not when used as streams)
# Also ignore using ns::operator<<;