Update cpplint.py, disable "All parameters should be named in a function"

This commit is contained in:
Soonho Kong 2013-09-19 22:19:39 -07:00 committed by Leonardo de Moura
parent ab6ca82e6f
commit 2b72c5f681

View file

@ -118,6 +118,7 @@ MAX_COLUMN = 2180
# - [x] Else clause should never be on same line as else (use 2 lines) [whitespace/newline] [4] # - [x] Else clause should never be on same line as else (use 2 lines) [whitespace/newline] [4]
# - [x] Extra space before ) [whitespace/parens] []2 # - [x] Extra space before ) [whitespace/parens] []2
# - [x] Is this a non-const reference? If so, make const or use a pointer. [runtime/references] [2] # - [x] Is this a non-const reference? If so, make const or use a pointer. [runtime/references] [2]
# - [x] All parameters should be named in a function
# =================================================== # ===================================================
# Modified: # Modified:
@ -3559,15 +3560,18 @@ def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
# Right now, this will only catch cases where there's a single argument, and # Right now, this will only catch cases where there's a single argument, and
# it's unnamed. It should probably be expanded to check for multiple # it's unnamed. It should probably be expanded to check for multiple
# arguments with some unnamed. # arguments with some unnamed.
function_match = Match(r'\s*(\)|=|(const)?\s*(;|\{|throw\(\)|>))', remainder) #
if function_match: # Disabled by Soonho Kong, 2013/09/19
if (not function_match.group(3) or #
function_match.group(3) == ';' or # function_match = Match(r'\s*(\)|=|(const)?\s*(;|\{|throw\(\)|>))', remainder)
('MockCallback<' not in raw_line and # if function_match:
'/*' not in raw_line)): # if (not function_match.group(3) or
error(filename, linenum, 'readability/function', 3, # function_match.group(3) == ';' or
'All parameters should be named in a function') # ('MockCallback<' not in raw_line and
return True # '/*' not in raw_line)):
# error(filename, linenum, 'readability/function', 3,
# 'All parameters should be named in a function')
# return True
# At this point, all that should be left is actual casts. # At this point, all that should be left is actual casts.
error(filename, linenum, 'readability/casting', 4, error(filename, linenum, 'readability/casting', 4,