unknown-rule-in-directive
What it does
Section titled “What it does”Reports a comment that disables rules of another tool (# rubocop:disable Foo/Bar) by a Group/Name whose group the tool does not have, for example the group of an extension that is not installed. A name inside a known group is not checked (the groups are listed in the grammar’s suppress directive-group rows).
Why it matters
Section titled “Why it matters”A directive with a group the tool does not have does not suppress what the author expects, so the finding stays or the directive is ignored. It is usually a typo in the group name or an extension that is missing in the project.
To fix, correct the name, or install the extension.
Example
Section titled “Example”... 1...end# rubocop:disable Foo/Bar...Configuration
Section titled “Configuration”lint: rules: unknown-rule-in-directive: warn # off (default), warn, errorEnabled by the presets: ruby/rubocop.
Suppress one line with sudsy-disable-next-line unknown-rule-in-directive in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| rubocop | Lint/CopDirectiveSyntax |
partial | only the unknown department of a cop name; not the other malformed directives or an unknown cop of a known department |