Class: RuboCop::Cop::Legion::Extension::RunnerIncludeHelpers
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Legion::Extension::RunnerIncludeHelpers
- Defined in:
- lib/rubocop/cop/legion/extension/runner_include_helpers.rb
Overview
Detects runner modules inside a ‘Runners` namespace that have method definitions but neither `include Helpers::Lex` (or full form) nor `extend self`. Without one of these, actors cannot call runner methods.
Constant Summary collapse
- MSG =
'Runner modules need `include Helpers::Lex` or `extend self` ' \ 'so actors can call methods via module.'
Instance Method Summary collapse
Instance Method Details
#on_module(node) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/rubocop/cop/legion/extension/runner_include_helpers.rb', line 46 def on_module(node) return unless inside_runners_namespace?(node) return unless method_definitions?(node) return if helpers_include?(node) return if extend_self?(node) add_offense(node.identifier) end |