MCPcopy Create free account
hub / github.com/BVLC/caffe / IsErrorSuppressedByNolint

Function IsErrorSuppressedByNolint

scripts/cpp_lint.py:504–517  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

_ShouldPrintErrorFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected