MCPcopy Create free account
hub / github.com/apache/mesos / Error

Function Error

support/cpplint.py:1221–1253  ·  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

1219
1220
1221def Error(filename, linenum, category, confidence, message):
1222 """Logs the fact we've found a lint error.
1223
1224 We log where the error was found, and also our confidence in the error,
1225 that is, how certain we are this is a legitimate style regression, and
1226 not a misidentification or a use that's sometimes justified.
1227
1228 False positives can be suppressed by the use of
1229 "cpplint(category)" comments on the offending line. These are
1230 parsed into _error_suppressions.
1231
1232 Args:
1233 filename: The name of the file containing the error.
1234 linenum: The number of the line containing the error.
1235 category: A string used to describe the "category" this bug
1236 falls under: "whitespace", say, or "runtime". Categories
1237 may have a hierarchy separated by slashes: "whitespace/indent".
1238 confidence: A number from 1-5 representing a confidence score for
1239 the error, with 5 meaning that we are certain of the problem,
1240 and 1 meaning that it could be a legitimate construct.
1241 message: The error message.
1242 """
1243 if _ShouldPrintError(category, confidence, linenum):
1244 _cpplint_state.IncrementErrorCount(category)
1245 if _cpplint_state.output_format == 'vs7':
1246 sys.stderr.write('%s(%s): error cpplint: [%s] %s [%d]\n' % (
1247 filename, linenum, category, message, confidence))
1248 elif _cpplint_state.output_format == 'eclipse':
1249 sys.stderr.write('%s:%s: warning: %s [%s] [%d]\n' % (
1250 filename, linenum, message, category, confidence))
1251 else:
1252 sys.stderr.write('%s:%s: %s [%s] [%d]\n' % (
1253 filename, linenum, message, category, confidence))
1254
1255
1256# Matches standard C++ escape sequences per 2.13.2.3 of the C++ standard.

Callers 15

ProcessFileFunction · 0.70
readFunction · 0.50
readCredentialFunction · 0.50
createMethod · 0.50
createMethod · 0.50
parseMethod · 0.50
synchronizedMethod · 0.50
parseFunction · 0.50
getManifestFunction · 0.50
validateManifestFunction · 0.50
validateImageIDFunction · 0.50
validateLayoutFunction · 0.50

Calls 3

_ShouldPrintErrorFunction · 0.85
IncrementErrorCountMethod · 0.80
writeMethod · 0.45

Tested by 15

parseFunction · 0.40
getManifestFunction · 0.40
validateManifestFunction · 0.40
validateImageIDFunction · 0.40
validateLayoutFunction · 0.40
validateFunction · 0.40
validateDigestFunction · 0.40
validateFunction · 0.40
foreachFunction · 0.40
parseFunction · 0.40
CfsFilterMethod · 0.40
CgroupsFilterMethod · 0.40