aboutsummaryrefslogtreecommitdiff
path: root/src/clint.py
diff options
context:
space:
mode:
authorJakob Schnitzer <mail@jakobschnitzer.de>2017-06-28 16:52:04 +0200
committerJakob Schnitzer <mail@jakobschnitzer.de>2017-06-28 16:52:04 +0200
commite8829710bc5f38208499e0ad38402eac24a67ac2 (patch)
tree4e1ae954c2e301adadbfa7038b823ea9ea2fb08e /src/clint.py
parentff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1 (diff)
parentf0dafa89c2b7602cfedf0bd3409858e4c212b0a2 (diff)
downloadrneovim-e8829710bc5f38208499e0ad38402eac24a67ac2.tar.gz
rneovim-e8829710bc5f38208499e0ad38402eac24a67ac2.tar.bz2
rneovim-e8829710bc5f38208499e0ad38402eac24a67ac2.zip
Merge branch 'master' into option-fixes
Diffstat (limited to 'src/clint.py')
-rwxr-xr-xsrc/clint.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/clint.py b/src/clint.py
index 5174521fb8..69a061d2ab 100755
--- a/src/clint.py
+++ b/src/clint.py
@@ -182,6 +182,7 @@ _ERROR_CATEGORIES = [
'build/include_order',
'build/printf_format',
'build/storage_class',
+ 'build/useless_fattr',
'readability/alt_tokens',
'readability/bool',
'readability/braces',
@@ -1225,6 +1226,10 @@ def CheckForHeaderGuard(filename, lines, error):
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found.
"""
+ if filename.endswith('.c.h') or FileInfo(filename).RelativePath() in set((
+ 'func_attr.h',
+ )):
+ return
cppvar = GetHeaderGuardCPPVariable(filename)
@@ -2524,6 +2529,8 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
r'(?<!\bklist_t)'
r'(?<!\bkliter_t)'
r'(?<!\bkhash_t)'
+ r'(?<!\bkbtree_t)'
+ r'(?<!\bkbitr_t)'
r'\((?:const )?(?:struct )?[a-zA-Z_]\w*(?: *\*(?:const)?)*\)'
r' +'
r'-?(?:\*+|&)?(?:\w+|\+\+|--|\()', cast_line)
@@ -2595,16 +2602,23 @@ def CheckBraces(filename, clean_lines, linenum, error):
else:
func_start_linenum = end_linenum + 1
while not clean_lines.lines[func_start_linenum] == '{':
- if not Match(r'^(?:\s*\b(?:FUNC_ATTR|REAL_FATTR)_\w+\b(?:\(\d+(, \d+)*\))?)+$',
- clean_lines.lines[func_start_linenum]):
+ attrline = Match(r'^((?!# *define).*?)(?:FUNC_ATTR|FUNC_API|REAL_FATTR)_\w+(?:\(\d+(, \d+)*\))?',
+ clean_lines.lines[func_start_linenum])
+ if attrline:
+ if len(attrline.group(1)) != 2:
+ error(filename, func_start_linenum,
+ 'whitespace/indent', 5,
+ 'Function attribute line should have 2-space '
+ 'indent')
+
+ func_start_linenum += 1
+ else:
if clean_lines.lines[func_start_linenum].endswith('{'):
error(filename, func_start_linenum,
'readability/braces', 5,
'Brace starting function body must be placed '
'after the function signature')
break
- else:
- func_start_linenum += 1
# An else clause should be on the same line as the preceding closing brace.
# If there is no preceding closing brace, there should be one.