Returns true if the specified error category is suppressed on this line. Consults the global error_suppressions map populated by ParseNolintSuppressions/ResetNolintSuppressions. Args: category: str, the category of the error. linenum: int, the current line number. Returns: bool
(category, linenum)
| 498 | |
| 499 | |
| 500 | def IsErrorSuppressedByNolint(category, linenum): |
| 501 | """Returns true if the specified error category is suppressed on this line. |
| 502 | |
| 503 | Consults the global error_suppressions map populated by |
| 504 | ParseNolintSuppressions/ResetNolintSuppressions. |
| 505 | |
| 506 | Args: |
| 507 | category: str, the category of the error. |
| 508 | linenum: int, the current line number. |
| 509 | Returns: |
| 510 | bool, True iff the error should be suppressed due to a NOLINT comment. |
| 511 | """ |
| 512 | return (linenum in _error_suppressions.get(category, set()) or |
| 513 | linenum in _error_suppressions.get(None, set())) |
| 514 | |
| 515 | def Match(pattern, s): |
| 516 | """Matches the string with the pattern, caching the compiled regexp.""" |
no test coverage detected