diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-01-25 13:29:52 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2020-02-07 09:22:55 +0100 |
commit | 7ce9a5c7da0fb5d6117cf9526c39e01faf7e908d (patch) | |
tree | 79dbef5225a1e09dcef257d0992ec8b9e4724190 /src/clint.py | |
parent | 405f49a9b16c5668a033b8be959564abc5f852ba (diff) | |
download | rneovim-7ce9a5c7da0fb5d6117cf9526c39e01faf7e908d.tar.gz rneovim-7ce9a5c7da0fb5d6117cf9526c39e01faf7e908d.tar.bz2 rneovim-7ce9a5c7da0fb5d6117cf9526c39e01faf7e908d.zip |
api: add nvim_get_runtime_file for finding runtime files
Diffstat (limited to 'src/clint.py')
-rwxr-xr-x | src/clint.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/clint.py b/src/clint.py index 675b67ccef..12bada6aac 100755 --- a/src/clint.py +++ b/src/clint.py @@ -270,6 +270,8 @@ _line_length = 80 # This is set by --extensions flag. _valid_extensions = set(['c', 'h']) +_RE_COMMENTLINE = re.compile(r'^\s*//') + def ParseNolintSuppressions(filename, raw_line, linenum, error): """Updates the global list of error-suppressions. @@ -1358,7 +1360,9 @@ def CheckForOldStyleComments(filename, line, linenum, error): linenum: The number of the line to check. error: The function to call with any errors found. """ - if line.find('/*') >= 0 and line[-1] != '\\': + # hack: allow /* inside comment line. Could be extended to allow them inside + # any // comment. + if line.find('/*') >= 0 and line[-1] != '\\' and not _RE_COMMENTLINE.match(line): error(filename, linenum, 'readability/old_style_comment', 5, '/*-style comment found, it should be replaced with //-style. ' '/*-style comments are only allowed inside macros. ' |