MCPcopy Create free account
hub / github.com/alibaba/GraphScope / _ShouldPrintError

Function _ShouldPrintError

analytical_engine/misc/cpplint.py:1659–1684  ·  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

1657
1658
1659def _ShouldPrintError(category, confidence, linenum):
1660 """If confidence >= verbose, category passes filter and is not suppressed."""
1661
1662 # There are three ways we might decide not to print an error message:
1663 # a "NOLINT(category)" comment appears in the source,
1664 # the verbosity level isn't high enough, or the filters filter it out.
1665 if IsErrorSuppressedByNolint(category, linenum):
1666 return False
1667
1668 if confidence < _cpplint_state.verbose_level:
1669 return False
1670
1671 is_filtered = False
1672 for one_filter in _Filters():
1673 if one_filter.startswith('-'):
1674 if category.startswith(one_filter[1:]):
1675 is_filtered = True
1676 elif one_filter.startswith('+'):
1677 if category.startswith(one_filter[1:]):
1678 is_filtered = False
1679 else:
1680 assert False # should have been checked for in SetFilter.
1681 if is_filtered:
1682 return False
1683
1684 return True
1685
1686
1687def Error(filename, linenum, category, confidence, message):

Callers 1

ErrorFunction · 0.85

Calls 2

_FiltersFunction · 0.85

Tested by

no test coverage detected