Class: RuboCop::Cop::Legion::Framework::ThorReservedRun
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Legion::Framework::ThorReservedRun
- Defined in:
- lib/rubocop/cop/legion/framework/thor_reserved_run.rb
Overview
Detects ‘def run` in Thor subclasses. Thor 1.5+ reserves the `run` method internally; defining it causes unexpected behavior.
Constant Summary collapse
- MSG =
'Thor 1.5+ reserves `run`. Use `map "run" => :method_name` or rename the method.'- SEVERITY =
:warning
Instance Method Summary collapse
Instance Method Details
#on_def(node) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/rubocop/cop/legion/framework/thor_reserved_run.rb', line 30 def on_def(node) return unless node.method_name == :run return unless inside_thor_class?(node) add_offense(node, severity: SEVERITY) end |