If confidence >= verbose, category passes filter and is not suppressed.
(category, confidence, linenum)
| 1186 | |
| 1187 | |
| 1188 | def _ShouldPrintError(category, confidence, linenum): |
| 1189 | """If confidence >= verbose, category passes filter and is not suppressed.""" |
| 1190 | |
| 1191 | # There are three ways we might decide not to print an error message: |
| 1192 | # a "NOLINT(category)" comment appears in the source, |
| 1193 | # the verbosity level isn't high enough, or the filters filter it out. |
| 1194 | if IsErrorSuppressedByNolint(category, linenum): |
| 1195 | return False |
| 1196 | |
| 1197 | if confidence < _cpplint_state.verbose_level: |
| 1198 | return False |
| 1199 | |
| 1200 | is_filtered = False |
| 1201 | for one_filter in _Filters(): |
| 1202 | if one_filter.startswith('-'): |
| 1203 | if category.startswith(one_filter[1:]): |
| 1204 | is_filtered = True |
| 1205 | elif one_filter.startswith('+'): |
| 1206 | if category.startswith(one_filter[1:]): |
| 1207 | is_filtered = False |
| 1208 | else: |
| 1209 | assert False # should have been checked for in SetFilter. |
| 1210 | if is_filtered: |
| 1211 | return False |
| 1212 | |
| 1213 | return True |
| 1214 | |
| 1215 | |
| 1216 | def Error(filename, linenum, category, confidence, message): |
no test coverage detected
searching dependent graphs…