useless-access-modifier
What it does
Section titled “What it does”Reports a bare private, protected, public or module_function that repeats the visibility already in force, or is followed by no method definition.
Why it matters
Section titled “Why it matters”The modifier does nothing, so a reader who relies on it believes methods are private that are not, or the other way round.
To fix, delete it, or move the methods it was meant to cover under it.
Example
Section titled “Example”... end private... private def qux; end publicendclass C... super end privateendclass D < B...Configuration
Section titled “Configuration”ruby: lint: rules: useless-access-modifier: warn # off, warn (default), errorEnabled by the presets: ruby/rubocop.
Suppress one line with sudsy-disable-next-line useless-access-modifier in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| rubocop | Lint/UselessAccessModifier |
full |