Class: Anchor::AvoidImplicitSuper

Inherits:
RuboCop::Cop::Cop
  • Object
show all
Defined in:
lib/cops/anchor/avoid_implicit_super.rb

Constant Summary collapse

MSG =
"Avoid implicit `super` calls. Prefer `super(**kwargs)`, " \
"`super()`, or a mix of explicit/implicit arguments, e.g. " \
"`super(id:, title:, **kwargs)`.".freeze

Instance Method Summary collapse

Instance Method Details

#on_def(node) ⇒ Object



11
12
13
14
15
# File 'lib/cops/anchor/avoid_implicit_super.rb', line 11

def on_def(node)
  return unless (zsuper = initialize_with_implicit_super?(node))

  add_offense(zsuper, message:)
end