aboutsummaryrefslogtreecommitdiff
path: root/clint.py
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-05-01 17:30:38 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-05-01 17:30:38 -0400
commitd542de4a76dd9e600ebcf1405efdc9d3090ad9a8 (patch)
tree60b1d2aad6205c74b7c2611fbbed45759a302f4f /clint.py
parent91afb30b667bbc321d351708f694d00b256be585 (diff)
parentcf4e1fb0f4962319eee292248d9c1f73be3a8d0c (diff)
downloadrneovim-d542de4a76dd9e600ebcf1405efdc9d3090ad9a8.tar.gz
rneovim-d542de4a76dd9e600ebcf1405efdc9d3090ad9a8.tar.bz2
rneovim-d542de4a76dd9e600ebcf1405efdc9d3090ad9a8.zip
Merge pull request #4688 from ZyX-I/clint-checks
Add check for boolean operators placement
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<<;