If confidence >= verbose, category passes filter and is not suppressed.
(category, confidence, linenum)
| 1160 | |
| 1161 | |
| 1162 | def _ShouldPrintError(category, confidence, linenum): |
| 1163 | """If confidence >= verbose, category passes filter and is not suppressed.""" |
| 1164 | |
| 1165 | # There are three ways we might decide not to print an error message: |
| 1166 | # a "NOLINT(category)" comment appears in the source, |
| 1167 | # the verbosity level isn't high enough, or the filters filter it out. |
| 1168 | if IsErrorSuppressedByNolint(category, linenum): |
| 1169 | return False |
| 1170 | |
| 1171 | if confidence < _cpplint_state.verbose_level: |
| 1172 | return False |
| 1173 | |
| 1174 | is_filtered = False |
| 1175 | for one_filter in _Filters(): |
| 1176 | if one_filter.startswith('-'): |
| 1177 | if category.startswith(one_filter[1:]): |
| 1178 | is_filtered = True |
| 1179 | elif one_filter.startswith('+'): |
| 1180 | if category.startswith(one_filter[1:]): |
| 1181 | is_filtered = False |
| 1182 | else: |
| 1183 | assert False # should have been checked for in SetFilter. |
| 1184 | if is_filtered: |
| 1185 | return False |
| 1186 | |
| 1187 | return True |
| 1188 | |
| 1189 | |
| 1190 | def Error(filename, linenum, category, confidence, message): |
no test coverage detected