diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-15 22:12:47 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-01 15:23:01 -0400 |
commit | a095a48987469865577d1035109877354bb67f5c (patch) | |
tree | 87795852f739e1a2ea783891119e0d102cd04683 /src/clint.py | |
parent | a2253744c9bcd9229be9533540075e977f0be2cd (diff) | |
download | rneovim-a095a48987469865577d1035109877354bb67f5c.tar.gz rneovim-a095a48987469865577d1035109877354bb67f5c.tar.bz2 rneovim-a095a48987469865577d1035109877354bb67f5c.zip |
clint: detect MAYBE and recommend TriState
Vim uses MAYBE for 3-value boolean with FALSE/TRUE/MAYBE.
Use TriState type instead to restrict to 3 values, kFalse/kTrue/kNone.
Diffstat (limited to 'src/clint.py')
-rwxr-xr-x | src/clint.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/clint.py b/src/clint.py index c0cedc0e5b..9fd93ce143 100755 --- a/src/clint.py +++ b/src/clint.py @@ -3299,6 +3299,13 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, error(filename, linenum, 'readability/bool', 4, 'Use %s instead of %s.' % (token.lower(), token)) + # Detect MAYBE + match = Search(r'\b(MAYBE)\b', line) + if match: + token = match.group(1) + error(filename, linenum, 'readability/bool', 4, + 'Use kNONE from TriState instead of %s.' % token) + # Detect preincrement/predecrement match = Match(r'^\s*(?:\+\+|--)', line) if match: |