aboutsummaryrefslogtreecommitdiff
path: root/src/clint.py
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-02-07 10:41:02 +0100
committerGitHub <noreply@github.com>2020-02-07 10:41:02 +0100
commit120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e (patch)
tree26311a11f79d7c67f7590ace4009bb730752974c /src/clint.py
parent017b25101a3bb428d96ee956cbe32c4fe6dcc00d (diff)
parentef2e6522c53d562928060a4872020fb8f32c8ff8 (diff)
downloadrneovim-120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e.tar.gz
rneovim-120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e.tar.bz2
rneovim-120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e.zip
Merge pull request #11757 from bfredl/treesitter_runtime
treesitter: add standard search path for parsers + bundle c parser properly
Diffstat (limited to 'src/clint.py')
-rwxr-xr-xsrc/clint.py6
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. '