Disable dowhile brace check by default

This commit is contained in:
reuk 2017-10-25 13:34:49 +01:00
parent 99592b3057
commit a00edd3e6c
1 changed files with 7 additions and 6 deletions

13
scripts/cpplint.py vendored
View File

@ -220,20 +220,21 @@ _ERROR_CATEGORIES = [
'readability/casting', 'readability/casting',
'readability/check', 'readability/check',
'readability/constructors', 'readability/constructors',
'readability/dowhile',
'readability/fn_size', 'readability/fn_size',
'readability/function_comment'
'readability/identifier_spacing',
'readability/identifiers',
'readability/inheritance', 'readability/inheritance',
'readability/multiline_comment', 'readability/multiline_comment',
'readability/multiline_string', 'readability/multiline_string',
'readability/identifier_spacing',
'readability/identifiers',
'readability/namespace', 'readability/namespace',
'readability/nolint', 'readability/nolint',
'readability/nul', 'readability/nul',
'readability/strings', 'readability/strings',
'readability/todo',
'readability/throw', 'readability/throw',
'readability/todo',
'readability/utf8', 'readability/utf8',
'readability/function_comment'
'runtime/arrays', 'runtime/arrays',
'runtime/casting', 'runtime/casting',
'runtime/endl', 'runtime/endl',
@ -282,7 +283,7 @@ _LEGACY_ERROR_CATEGORIES = [
# flag. By default all errors are on, so only add here categories that should be # flag. By default all errors are on, so only add here categories that should be
# off by default (i.e., categories that must be enabled by the --filter= flags). # off by default (i.e., categories that must be enabled by the --filter= flags).
# All entries here should start with a '-' or '+', as in the --filter= flag. # All entries here should start with a '-' or '+', as in the --filter= flag.
_DEFAULT_FILTERS = ['-build/include_alpha'] _DEFAULT_FILTERS = ['-build/include_alpha', '-readability/dowhile']
# The default list of categories suppressed for C (not C++) files. # The default list of categories suppressed for C (not C++) files.
_DEFAULT_C_SUPPRESSED_CATEGORIES = [ _DEFAULT_C_SUPPRESSED_CATEGORIES = [
@ -4197,7 +4198,7 @@ def CheckDoWhile(filename, clean_lines, linenum, error):
if Search(r'}\s*while\s*\(', line): if Search(r'}\s*while\s*\(', line):
do_found, num = FindDoStart(clean_lines, linenum) do_found, num = FindDoStart(clean_lines, linenum)
if do_found: if do_found:
error(filename, linenum, 'readability/braces', 4, error(filename, linenum, 'readability/dowhile', 4,
'while statement of do...while loop should be on a separate line to the closing brace') 'while statement of do...while loop should be on a separate line to the closing brace')
def CheckTrailingSemicolon(filename, clean_lines, linenum, error): def CheckTrailingSemicolon(filename, clean_lines, linenum, error):