MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / _ShouldPrintError

Function _ShouldPrintError

rtpose_wrapper/scripts/cpp_lint.py:961–985  ·  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

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

Callers 1

ErrorFunction · 0.85

Calls 2

_FiltersFunction · 0.85

Tested by

no test coverage detected