MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / _ShouldPrintError

Function _ShouldPrintError

steps/cpplint.py:1670–1695  ·  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

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

Callers 1

ErrorFunction · 0.85

Calls 2

_FiltersFunction · 0.85

Tested by

no test coverage detected