Ignore comments (design notes §8.3): Mutare's grammar under each configured prefix
(default juggernaut:ignore and mutare:ignore).
# <prefix>covers one line: its own line when it follows code, else the next code line, reading through comment lines (a blank line ends the search, and the directive then covers nothing);# <prefix>-start...# <prefix>-endcover every line between them, both included; regions do not nest;# <prefix>-filecovers the whole file.
Right after the verb, an optional [family, family:label, ...] filter, then the
reason. A directive matches a mutant when it covers the mutant's first line and the
filter is absent or names its family (and, with a label, its variant,
case-insensitively). When several match, the most specific filter wins (label, then
family, then none), then the narrowest scope (line, region, file), then the earliest
comment.
Errors (exit 2): an unpaired or nested region marker, an end marker of
another prefix than the open start, an unknown label for a known
family, and a juggernaut:ignore directive without a reason (Juggernaut's own prefix
requires one; mutare:ignore keeps Mutare's rule). Warnings: a directive that ignores
nothing, an unknown family, a malformed filter item (a family not written in lower case
letters and underscores, or an empty label or one holding a space or tab) or an empty
filter, and a comment that claims a prefix's namespace with
an unknown verb (# mutare:ingore). Under strict_ignores warnings are errors too.
Summary
Functions
Parses the directives among comments of a file whose lines are lines.
The directive that ignores a mutant on line of family with variant, or nil.
Returns the directive's index in directives too, so callers can track use.
The ignore map of a mutant (Juggernaut.Mutant.ignore).
Warnings for the directives (by index) that ignored no mutant.
Types
@type comment() :: %{line: pos_integer(), column: pos_integer(), text: String.t()}
@type issue() :: %{code: atom(), message: String.t(), line: pos_integer()}
@type parsed() :: %{ directives: [Juggernaut.Ignore.Directive.t()], errors: [issue()], warnings: [issue()] }
Functions
Parses the directives among comments of a file whose lines are lines.
@spec resolve( [Juggernaut.Ignore.Directive.t()], pos_integer(), atom(), String.t() | nil ) :: {non_neg_integer(), Juggernaut.Ignore.Directive.t()} | nil
The directive that ignores a mutant on line of family with variant, or nil.
Returns the directive's index in directives too, so callers can track use.
@spec to_mutant_ignore(Juggernaut.Ignore.Directive.t()) :: Juggernaut.Mutant.ignore()
The ignore map of a mutant (Juggernaut.Mutant.ignore).
@spec unused([Juggernaut.Ignore.Directive.t()], MapSet.t(non_neg_integer())) :: [ issue() ]
Warnings for the directives (by index) that ignored no mutant.