unused-method-argument
What it does
Section titled “What it does”Reports a method parameter that the method never reads. Names that start with _, empty methods and methods that only raise NotImplementedError are left alone. No fix.
Why it matters
Section titled “Why it matters”An argument that is never read is either dead (callers pass a value for nothing) or a mistake (the method was meant to use it). Naming it with a leading _ says that it is left out on purpose, as in an override that must keep the signature.
To fix, remove the parameter, or prefix its name with _.
Example
Section titled “Example”...def b(*) [1].map { |_v| 1 }enddef c(p) 1enddef d(&blk)...Configuration
Section titled “Configuration”ruby: lint: rules: unused-method-argument: warn # off (default), warn, errorEnabled by the presets: ruby/rubocop.
Suppress one line with sudsy-disable-next-line unused-method-argument 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/UnusedMethodArgument |
full |