missing-super
What it does
Section titled “What it does”Reports initialize of a class with a parent other than Object, and the callbacks inherited and method_added, that do not call super.
Why it matters
Section titled “Why it matters”The parent’s initialize sets up the object, so a subclass that does not call it leaves the parent’s state unset. The inherited and method_added hooks of a base class do work that a subclass must not skip.
To fix, call super.
Example
Section titled “Example”...endclass D < B def initialize endend...Configuration
Section titled “Configuration”ruby: lint: rules: missing-super: warn # off (default), warn, errorEnabled by the presets: ruby/rubocop.
Suppress one line with sudsy-disable-next-line missing-super 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/MissingSuper |
full |