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

Function _ShouldPrintError

scripts/cpp_lint.py:965–989  ·  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

963
964
965def _ShouldPrintError(category, confidence, linenum):
966 """If confidence >= verbose, category passes filter and is not suppressed."""
967
968 # There are three ways we might decide not to print an error message:
969 # a "NOLINT(category)" comment appears in the source,
970 # the verbosity level isn't high enough, or the filters filter it out.
971 if IsErrorSuppressedByNolint(category, linenum):
972 return False
973 if confidence < _cpplint_state.verbose_level:
974 return False
975
976 is_filtered = False
977 for one_filter in _Filters():
978 if one_filter.startswith('-'):
979 if category.startswith(one_filter[1:]):
980 is_filtered = True
981 elif one_filter.startswith('+'):
982 if category.startswith(one_filter[1:]):
983 is_filtered = False
984 else:
985 assert False # should have been checked for in SetFilter.
986 if is_filtered:
987 return False
988
989 return True
990
991
992def Error(filename, linenum, category, confidence, message):

Callers 1

ErrorFunction · 0.85

Calls 2

_FiltersFunction · 0.85

Tested by

no test coverage detected