MCPcopy Create free account
hub / github.com/tensorflow/tfjs / Error

Function Error

tfjs-backend-wasm/tools/cpplint.py:1216–1248  ·  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

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

Callers 15

getSurfaceMethod · 0.85
softmaxFunction · 0.85
getSwitchedCoordsFunction · 0.85
getSourceCoordsFunction · 0.85
getCoordsFunction · 0.85
getFinalCoordFunction · 0.85
getCoordsFunction · 0.85
getUserCodeMethod · 0.85
getCoordsDataTypeFunction · 0.85
getCoordsXYZFunction · 0.85
getMainHeaderStringFunction · 0.85
inferFromImplicitShapeFunction · 0.85

Calls 3

_ShouldPrintErrorFunction · 0.85
IncrementErrorCountMethod · 0.80
writeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…