Lines Matching refs:error

132       error messages whose category names pass the filters will be printed.
286 # We categorize each error message we print. Here are the categories.
288 # If you add a new error message with a new category, add it to the list
369 # These error categories are no longer enforced by cpplint, but for backwards-
633 'error.h',
852 # {str, set(int)}: a map from error categories to sets of linenumbers
911 # {str, bool}: a map from error categories to booleans which indicate if the
960 def ParseNolintSuppressions(filename, raw_line, linenum, error):
961 """Updates the global list of line error-suppressions.
964 error_suppressions store. Reports an error if the NOLINT comment
971 error: function, an error handler.
988 error(filename, linenum, 'readability/nolint', 5,
989 'Unknown NOLINT error category: %s' % category)
993 """Updates the list of global error suppressions.
1017 """Returns true if the specified error category is suppressed on this line.
1023 category: str, the category of the error.
1026 bool, True iff the error should be suppressed due to a NOLINT comment or
1083 raise an _IncludeError with an appropriate error message.
1087 # needs to move backwards, CheckNextIncludeOrder will raise an error.
1104 _INITIAL_SECTION: "... nothing. (This can't be an error.)",
1191 """Returns a non-empty error message if the next header is out of order.
1201 error message describing what's wrong.
1256 # filters to apply when emitting error messages
1261 self.errors_by_category = {} # string to int dict storing error counts
1262 self.quiet = False # Suppress non-error messagess?
1299 """Sets the error-message filters.
1302 error message.
1317 """ Adds more filters to the existing list of error-message filters. """
1336 """Sets the module's error statistic back to zero."""
1341 """Bumps the module's error statistic."""
1392 error = xml.etree.ElementTree.SubElement(testcase, 'error')
1393 error.text = '\n'.join(self._junit_errors)
1460 """Sets the module's error-message filters.
1463 error message.
1517 def Check(self, error, filename, linenum):
1521 error: The function to call with any errors found.
1539 error(filename, linenum, 'readability/fn_size', error_level,
1542 ' (error triggered by exceeding %d lines).' % (
1663 # There are three ways we might decide not to print an error message:
1689 """Logs the fact we've found a lint error.
1691 We log where the error was found, and also our confidence in the error,
1700 filename: The name of the file containing the error.
1701 linenum: The number of the line containing the error.
1706 the error, with 5 meaning that we are certain of the problem,
1708 message: The error message.
1713 _cpplint_state.PrintError('%s(%s): error cpplint: [%s] %s [%d]\n' % (
1874 def RemoveMultiLineComments(filename, lines, error):
1883 error(filename, lineix_begin + 1, 'readability/multiline_comment', 5,
2239 def CheckForCopyright(filename, lines, error):
2240 """Logs an error if no Copyright message appears at the top of the file."""
2247 error(filename, 0, 'legal/copyright', 5,
2369 def CheckForHeaderGuard(filename, clean_lines, error):
2372 Logs an error if no #ifndef header guard is present. For other
2378 error: The function to call with any errors found.
2381 # Don't check for header guards if there are error suppression
2420 error(filename, 0, 'build/header_guard', 5,
2433 error)
2434 error(filename, ifndef_linenum, 'build/header_guard', error_level,
2439 error)
2444 error(filename, endif_linenum, 'build/header_guard', 0,
2463 error(filename, endif_linenum, 'build/header_guard', 0,
2468 error(filename, endif_linenum, 'build/header_guard', 5,
2472 def CheckHeaderFileIncluded(filename, include_state, error):
2473 """Logs an error if a source file does not include its header."""
2502 error(filename, first_include, 'build/include', 5, message)
2505 def CheckForBadCharacters(filename, lines, error):
2506 """Logs an error for each line containing bad characters.
2520 error: The function to call with any errors found.
2524 error(filename, linenum, 'readability/utf8', 5,
2527 error(filename, linenum, 'readability/nul', 5, 'Line contains NUL byte.')
2530 def CheckForNewlineAtEOF(filename, lines, error):
2531 """Logs an error if there is no newline char at the end of the file.
2536 error: The function to call with any errors found.
2544 error(filename, len(lines) - 2, 'whitespace/ending_newline', 5,
2548 def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):
2549 """Logs an error if we see /* ... */ or "..." that extend past one line.
2563 error: The function to call with any errors found.
2572 error(filename, linenum, 'readability/multiline_comment', 5,
2580 error(filename, linenum, 'readability/multiline_string', 5,
2616 def CheckPosixThreading(filename, clean_lines, linenum, error):
2629 error: The function to call with any errors found.
2636 error(filename, linenum, 'runtime/threadsafe_fn', 2,
2642 def CheckVlogArguments(filename, clean_lines, linenum, error):
2652 error: The function to call with any errors found.
2656 error(filename, linenum, 'runtime/vlog', 5,
2666 def CheckInvalidIncrement(filename, clean_lines, linenum, error):
2680 error: The function to call with any errors found.
2684 error(filename, linenum, 'runtime/invalid_increment', 5,
2712 def CheckBegin(self, filename, clean_lines, linenum, error):
2723 error: The function to call with any errors found.
2727 def CheckEnd(self, filename, clean_lines, linenum, error):
2736 error: The function to call with any errors found.
2792 def CheckBegin(self, filename, clean_lines, linenum, error):
2797 def CheckEnd(self, filename, clean_lines, linenum, error):
2808 error(filename, i, 'readability/constructors', 3,
2824 error(filename, linenum, 'whitespace/indent', 3,
2836 def CheckEnd(self, filename, clean_lines, linenum, error):
2872 error(filename, linenum, 'readability/namespace', 5,
2881 error(filename, linenum, 'readability/namespace', 5,
2885 error(filename, linenum, 'readability/namespace', 5,
3016 # Not sure if template argument list or syntax error in file
3079 def Update(self, filename, clean_lines, linenum, error):
3086 error: The function to call with any errors found.
3176 self.stack[-1].CheckBegin(filename, clean_lines, linenum, error)
3200 error(filename, linenum, 'whitespace/indent', 3,
3239 self.stack[-1].CheckEnd(filename, clean_lines, linenum, error)
3255 def CheckCompletedBlocks(self, filename, error):
3261 error: The function to call with any errors found.
3268 error(filename, obj.starting_linenum, 'build/class', 5,
3272 error(filename, obj.starting_linenum, 'build/namespaces', 5,
3278 nesting_state, error):
3279 r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
3302 error: A callable to which errors are reported, which takes 4 arguments:
3303 filename, line number, error level, and message
3310 error(filename, linenum, 'runtime/printf_format', 3,
3314 error(filename, linenum, 'runtime/printf_format', 2,
3321 error(filename, linenum, 'build/printf_format', 3,
3332 error(filename, linenum, 'build/storage_class', 5,
3337 error(filename, linenum, 'build/endif_comment', 5,
3341 error(filename, linenum, 'build/forward_decl', 5,
3346 error(filename, linenum, 'build/deprecated', 3,
3357 error(filename, linenum, 'runtime/member_string_references', 2,
3430 error(filename, linenum, 'runtime/explicit', 5,
3434 error(filename, linenum, 'runtime/explicit', 5,
3438 error(filename, linenum, 'runtime/explicit', 5,
3442 def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error):
3449 error: The function to call with any errors found.
3488 error(filename, linenum, 'whitespace/parens', 4,
3491 error(filename, linenum, 'whitespace/parens', 2,
3499 # error, silence those for now by restricting them to highest verbosity.
3501 error(filename, linenum, 'whitespace/parens', 0,
3504 error(filename, linenum, 'whitespace/parens', 4,
3510 # try to give a more descriptive error message.
3512 error(filename, linenum, 'whitespace/parens', 2,
3515 error(filename, linenum, 'whitespace/parens', 2,
3535 error):
3545 line, error)
3549 function_state, error):
3569 error: The function to call with any errors found.
3607 error(filename, linenum, 'readability/fn_size', 5,
3610 function_state.Check(error, filename, linenum)
3619 def CheckComment(line, filename, linenum, next_line_start, error):
3627 error: The function to call with any errors found.
3639 error(filename, linenum, 'whitespace/comments', 2,
3649 error(filename, linenum, 'whitespace/todo', 2,
3654 error(filename, linenum, 'readability/todo', 2,
3661 error(filename, linenum, 'whitespace/todo', 2,
3669 error(filename, linenum, 'whitespace/comments', 4,
3673 def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
3688 error: The function to call with any errors found.
3752 error(filename, linenum, 'whitespace/blank_line', 2,
3768 error(filename, linenum, 'whitespace/blank_line', 3,
3774 error(filename, linenum, 'whitespace/blank_line', 3,
3782 CheckComment(line, filename, linenum, next_line_start, error)
3791 error(filename, linenum, 'whitespace/braces', 5,
3798 error(filename, linenum, 'whitespace/forcolon', 2,
3802 def CheckOperatorSpacing(filename, clean_lines, linenum, error):
3809 error: The function to call with any errors found.
3836 error(filename, linenum, 'whitespace/operators', 4,
3856 error(filename, linenum, 'whitespace/operators', 3,
3868 error(filename, linenum, 'whitespace/operators', 3,
3879 error(filename, linenum, 'whitespace/operators', 3,
3890 error(filename, linenum, 'whitespace/operators', 3,
3907 error(filename, linenum, 'whitespace/operators', 3,
3913 error(filename, linenum, 'whitespace/operators', 4,
3917 def CheckParenthesisSpacing(filename, clean_lines, linenum, error):
3924 error: The function to call with any errors found.
3931 error(filename, linenum, 'whitespace/parens', 5,
3947 error(filename, linenum, 'whitespace/parens', 5,
3950 error(filename, linenum, 'whitespace/parens', 5,
3955 def CheckCommaSpacing(filename, clean_lines, linenum, error):
3962 error: The function to call with any errors found.
3979 error(filename, linenum, 'whitespace/comma', 3,
3987 error(filename, linenum, 'whitespace/semicolon', 3,
4054 def CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error):
4063 error: The function to call with any errors found.
4118 error(filename, linenum, 'whitespace/braces', 5,
4123 error(filename, linenum, 'whitespace/braces', 5,
4130 error(filename, linenum, 'whitespace/semicolon', 5,
4133 error(filename, linenum, 'whitespace/semicolon', 5,
4138 error(filename, linenum, 'whitespace/semicolon', 5,
4160 def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
4170 error: The function to call with any errors found.
4211 error(filename, linenum, 'whitespace/blank_line', 3,
4238 def CheckBraces(filename, clean_lines, linenum, error):
4245 error: The function to call with any errors found.
4264 error(filename, linenum, 'whitespace/braces', 4,
4271 error(filename, linenum, 'whitespace/newline', 4,
4285 error(filename, linenum, 'readability/braces', 5,
4288 error(filename, linenum, 'readability/braces', 5,
4293 error(filename, linenum, 'whitespace/newline', 4,
4298 error(filename, linenum, 'whitespace/newline', 4,
4338 error(filename, linenum, 'readability/braces', 4,
4344 # With ambiguous nested if statements, this will error out on the
4349 error(filename, linenum, 'readability/braces', 4,
4353 error(filename, linenum, 'readability/braces', 4,
4357 def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
4364 error: The function to call with any errors found.
4490 # nested blocks with trailing semicolons, we will get the error
4496 error)
4498 error)
4500 error(filename, endlinenum, 'readability/braces', 4,
4504 def CheckEmptyBlockBody(filename, clean_lines, linenum, error):
4511 error: The function to call with any errors found.
4519 # is likely an error.
4532 error(filename, end_linenum, 'whitespace/empty_conditional_body', 5,
4535 error(filename, end_linenum, 'whitespace/empty_loop_body', 5,
4542 # Return without logging an error if it has no brackets.
4596 # Found an else clause, so don't log an error.
4604 error(filename, end_linenum, 'whitespace/empty_if_body', 4,
4631 def CheckCheck(filename, clean_lines, linenum, error):
4638 error: The function to call with any errors found.
4654 # semicolon, assume users will log their own custom error messages
4736 # descriptive error message like:
4742 # or rhs gets long, the error message might become unreadable.
4743 error(filename, linenum, 'readability/check', 2,
4749 def CheckAltTokens(filename, clean_lines, linenum, error):
4756 error: The function to call with any errors found.
4776 error(filename, linenum, 'readability/alt_tokens', 2,
4814 error):
4828 error: The function to call with any errors found.
4839 error(filename, linenum, 'whitespace/tab', 1,
4847 # if(match($0, " +(error|private|public|protected):")) complain = 0;
4870 error(filename, linenum, 'whitespace/indent', 3,
4875 error(filename, linenum, 'whitespace/end_of_line', 4,
4904 error(filename, linenum, 'whitespace/line_length', 2,
4919 error(filename, linenum, 'whitespace/newline', 0,
4923 CheckBraces(filename, clean_lines, linenum, error)
4924 CheckTrailingSemicolon(filename, clean_lines, linenum, error)
4925 CheckEmptyBlockBody(filename, clean_lines, linenum, error)
4926 CheckSpacing(filename, clean_lines, linenum, nesting_state, error)
4927 CheckOperatorSpacing(filename, clean_lines, linenum, error)
4928 CheckParenthesisSpacing(filename, clean_lines, linenum, error)
4929 CheckCommaSpacing(filename, clean_lines, linenum, error)
4930 CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error)
4931 CheckSpacingForFunctionCall(filename, clean_lines, linenum, error)
4932 CheckCheck(filename, clean_lines, linenum, error)
4933 CheckAltTokens(filename, clean_lines, linenum, error)
4936 CheckSectionSpacing(filename, clean_lines, classinfo, linenum, error)
5053 def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
5065 error: The function to call with any errors found.
5081 error(filename, linenum, 'build/include_subdir', 4,
5093 error(filename, linenum, 'build/include', 4,
5101 error(filename, linenum, 'build/include', 4,
5106 # filename. Otherwise we get an erroneous error "...should include its
5107 # header" error later.
5134 error(filename, linenum, 'build/include_order', 4,
5140 error(filename, linenum, 'build/include_alpha', 4,
5232 include_state, nesting_state, error):
5246 error: The function to call with any errors found.
5256 CheckIncludeLine(filename, clean_lines, linenum, include_state, error)
5267 CheckCasts(filename, clean_lines, linenum, error)
5268 CheckGlobalStatic(filename, clean_lines, linenum, error)
5269 CheckPrintf(filename, clean_lines, linenum, error)
5276 # (level 1 error)
5283 error(filename, linenum, 'runtime/int', 4,
5288 error(filename, linenum, 'runtime/int', 4,
5298 error(filename, linenum, 'runtime/operator', 4,
5304 error(filename, linenum, 'readability/braces', 4,
5320 error(filename, linenum, 'runtime/printf', 4,
5327 error(filename, linenum, 'runtime/memset', 4,
5333 error(filename, linenum, 'build/namespaces_literals', 5,
5337 error(filename, linenum, 'build/namespaces', 5,
5347 # report the error.
5376 error(filename, linenum, 'runtime/arrays', 1,
5386 error(filename, linenum, 'build/namespaces_headers', 4,
5392 def CheckGlobalStatic(filename, clean_lines, linenum, error):
5399 error: The function to call with any errors found.
5439 error(filename, linenum, 'runtime/string', 4,
5444 error(filename, linenum, 'runtime/string', 4,
5449 error(filename, linenum, 'runtime/init', 4,
5453 def CheckPrintf(filename, clean_lines, linenum, error):
5460 error: The function to call with any errors found.
5468 error(filename, linenum, 'runtime/printf', 3,
5474 error(filename, linenum, 'runtime/printf', 5,
5478 error(filename, linenum, 'runtime/printf', 4,
5563 nesting_state, error):
5575 error: The function to call with any errors found.
5695 error(filename, linenum, 'runtime/references', 2,
5701 def CheckCasts(filename, clean_lines, linenum, error):
5708 error: The function to call with any errors found.
5756 error(filename, linenum, 'readability/casting', 4,
5763 r'\((int|float|double|bool|char|u?int(16|32|64)|size_t)\)', error)
5770 r'\((char\s?\*+\s?)\)\s*"', error):
5775 r'\((\w+\s?\*+\s?)\)', error)
5792 # Try a better error message when the & is bound to something
5809 error(filename, linenum, 'readability/casting', 4,
5814 error(filename, linenum, 'runtime/casting', 4,
5820 def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
5830 error: The function to call with any errors found.
5833 True if an error was emitted.
5866 error(filename, linenum, 'readability/casting', 4,
6061 def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
6075 error: The function to call with any errors found.
6157 error(filename, required[required_header_unstripped][0],
6165 def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
6175 error: The function to call with any errors found.
6180 error(filename, linenum, 'build/explicit_make_pair',
6186 def CheckRedundantVirtual(filename, clean_lines, linenum, error):
6193 error: The function to call with any errors found.
6239 error(filename, linenum, 'readability/inheritance', 4,
6250 def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error):
6257 error: The function to call with any errors found.
6274 error(filename, linenum, 'readability/inheritance', 4,
6336 error):
6339 error(filename, linenum, 'runtime/indentation_namespace', 4,
6344 include_state, function_state, nesting_state, error,
6358 error: A callable to which errors are reported, which takes 4 arguments:
6359 filename, line number, error level, and message
6362 arguments: filename, clean_lines, line, error
6365 ParseNolintSuppressions(filename, raw_lines[line], line, error)
6366 nesting_state.Update(filename, clean_lines, line, error)
6368 error)
6370 CheckForFunctionLengths(filename, clean_lines, line, function_state, error)
6371 CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
6372 CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error)
6374 nesting_state, error)
6375 CheckForNonConstReference(filename, clean_lines, line, nesting_state, error)
6377 nesting_state, error)
6378 CheckVlogArguments(filename, clean_lines, line, error)
6379 CheckPosixThreading(filename, clean_lines, line, error)
6380 CheckInvalidIncrement(filename, clean_lines, line, error)
6381 CheckMakePairUsesDeduction(filename, clean_lines, line, error)
6382 CheckRedundantVirtual(filename, clean_lines, line, error)
6383 CheckRedundantOverrideOrFinal(filename, clean_lines, line, error)
6386 check_fn(filename, clean_lines, line, error)
6388 def FlagCxx11Features(filename, clean_lines, linenum, error):
6395 error: The function to call with any errors found.
6403 error(filename, linenum, 'build/c++tr1', 5,
6418 error(filename, linenum, 'build/c++11', 5,
6434 error(filename, linenum, 'build/c++11', 5,
6440 def FlagCxx14Features(filename, clean_lines, linenum, error):
6447 error: The function to call with any errors found.
6455 error(filename, linenum, 'build/c++14', 5,
6459 def ProcessFileData(filename, file_extension, lines, error,
6461 """Performs lint checks and reports any errors to the given error function.
6468 error: A callable to which errors are reported, which takes 4 arguments:
6469 filename, line number, error level, and message
6472 arguments: filename, clean_lines, line, error
6483 CheckForCopyright(filename, lines, error)
6485 RemoveMultiLineComments(filename, lines, error)
6489 CheckForHeaderGuard(filename, clean_lines, error)
6493 include_state, function_state, nesting_state, error,
6495 FlagCxx11Features(filename, clean_lines, line, error)
6496 nesting_state.CheckCompletedBlocks(filename, error)
6498 CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error)
6502 CheckHeaderFileIncluded(filename, include_state, error)
6506 CheckForBadCharacters(filename, lines, error)
6508 CheckForNewlineAtEOF(filename, lines, error)
6605 vlevel: The level of errors to report. Every error of confidence
6610 arguments: filename, clean_lines, line, error
6685 # Suppress printing anything if --quiet was passed unless the error
6693 """Prints a brief usage string and exits, optionally with an error message.
6696 message: The optional error message.
6715 """Prints a list of all the error-categories used by error messages.
6895 # If --quiet is passed, suppress printing error count unless there are errors.