If confidence >= verbose, category passes filter and is not suppressed.
(category, confidence, linenum)
| 959 | |
| 960 | |
| 961 | def _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 | |
| 988 | def Error(filename, linenum, category, confidence, message): |
no test coverage detected