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

Function _ShouldPrintError

tfjs-backend-wasm/tools/cpplint.py:1188–1213  ·  view source on GitHub ↗

If confidence >= verbose, category passes filter and is not suppressed.

(category, confidence, linenum)

Source from the content-addressed store, hash-verified

1186
1187
1188def _ShouldPrintError(category, confidence, linenum):
1189 """If confidence >= verbose, category passes filter and is not suppressed."""
1190
1191 # There are three ways we might decide not to print an error message:
1192 # a "NOLINT(category)" comment appears in the source,
1193 # the verbosity level isn't high enough, or the filters filter it out.
1194 if IsErrorSuppressedByNolint(category, linenum):
1195 return False
1196
1197 if confidence < _cpplint_state.verbose_level:
1198 return False
1199
1200 is_filtered = False
1201 for one_filter in _Filters():
1202 if one_filter.startswith('-'):
1203 if category.startswith(one_filter[1:]):
1204 is_filtered = True
1205 elif one_filter.startswith('+'):
1206 if category.startswith(one_filter[1:]):
1207 is_filtered = False
1208 else:
1209 assert False # should have been checked for in SetFilter.
1210 if is_filtered:
1211 return False
1212
1213 return True
1214
1215
1216def Error(filename, linenum, category, confidence, message):

Callers 1

ErrorFunction · 0.85

Calls 2

_FiltersFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…