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