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