MCPcopy Create free account
hub / github.com/BVLC/caffe / Error

Function Error

scripts/cpp_lint.py:992–1024  ·  view source on GitHub ↗

Logs the fact we've found a lint error. We log where the error was found, and also our confidence in the error, that is, how certain we are this is a legitimate style regression, and not a misidentification or a use that's sometimes justified. False positives can be suppressed by the use o

(filename, linenum, category, confidence, message)

Source from the content-addressed store, hash-verified

990
991
992def Error(filename, linenum, category, confidence, message):
993 """Logs the fact we've found a lint error.
994
995 We log where the error was found, and also our confidence in the error,
996 that is, how certain we are this is a legitimate style regression, and
997 not a misidentification or a use that's sometimes justified.
998
999 False positives can be suppressed by the use of
1000 "cpplint(category)" comments on the offending line. These are
1001 parsed into _error_suppressions.
1002
1003 Args:
1004 filename: The name of the file containing the error.
1005 linenum: The number of the line containing the error.
1006 category: A string used to describe the "category" this bug
1007 falls under: "whitespace", say, or "runtime". Categories
1008 may have a hierarchy separated by slashes: "whitespace/indent".
1009 confidence: A number from 1-5 representing a confidence score for
1010 the error, with 5 meaning that we are certain of the problem,
1011 and 1 meaning that it could be a legitimate construct.
1012 message: The error message.
1013 """
1014 if _ShouldPrintError(category, confidence, linenum):
1015 _cpplint_state.IncrementErrorCount(category)
1016 if _cpplint_state.output_format == 'vs7':
1017 sys.stderr.write('%s(%s): %s [%s] [%d]\n' % (
1018 filename, linenum, message, category, confidence))
1019 elif _cpplint_state.output_format == 'eclipse':
1020 sys.stderr.write('%s:%s: warning: %s [%s] [%d]\n' % (
1021 filename, linenum, message, category, confidence))
1022 else:
1023 sys.stderr.write('%s:%s: %s [%s] [%d]\n' % (
1024 filename, linenum, message, category, confidence))
1025
1026
1027# Matches standard C++ escape sequences per 2.13.2.3 of the C++ standard.

Callers 1

ProcessFileFunction · 0.85

Calls 3

_ShouldPrintErrorFunction · 0.85
IncrementErrorCountMethod · 0.80
writeMethod · 0.80

Tested by

no test coverage detected