Per-line suppression.
A finding is suppressed when the line it points at ends with a #nolint comment:
var ok = 1 #nolint
The comment is looked for in the source text, because comments are not part of the AST. Requiring it at the end of the line keeps the check trivial and means a marker inside a string literal (echo "#nolint") never matches.
Consts
suppressionMarker = "#nolint"
- Source Edit
Procs
proc isSuppressed(line: string): bool {....raises: [], tags: [], forbids: [].}
- True when line ends with a #nolint comment. Source Edit
proc isSuppressed(lines: seq[string]; line: int): bool {....raises: [], tags: [], forbids: [].}
- True when the 1-based line ends with a #nolint comment. Out-of-range lines are never suppressed. Source Edit