mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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.
This commit is contained in:
parent
91afb30b66
commit
a1f985f60a
7
clint.py
7
clint.py
@ -2305,6 +2305,13 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
|
|||||||
if match:
|
if match:
|
||||||
error(filename, linenum, 'whitespace/operators', 3,
|
error(filename, linenum, 'whitespace/operators', 3,
|
||||||
'Missing spaces around %s' % match.group(1))
|
'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
|
# We allow no-spaces around << when used like this: 10<<20, but
|
||||||
# not otherwise (particularly, not when used as streams)
|
# not otherwise (particularly, not when used as streams)
|
||||||
# Also ignore using ns::operator<<;
|
# Also ignore using ns::operator<<;
|
||||||
|
Loading…
Reference in New Issue
Block a user