useless-method-definition
What it does
Section titled “What it does”Reports a method whose whole body is a bare super.
Why it matters
Section titled “Why it matters”The method does what the inherited one does, so the definition adds only code.
To fix, delete the method.
Example
Section titled “Example”...class B < StandardError def initialize(msg) super(msg) end def foo=(_v)...endclass C def run super end...Configuration
Section titled “Configuration”ruby: lint: rules: useless-method-definition: warn # off (default), warn, errorEnabled by the presets: ruby/rubocop.
Suppress one line with sudsy-disable-next-line useless-method-definition 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/UselessMethodDefinition |
full |