Class: RuboCop::Cop::Netlify::SidekiqKeywordArguments
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Netlify::SidekiqKeywordArguments
- Defined in:
- lib/rubocop/cop/netlify/sidekiq_keyword_arguments.rb
Overview
This cop checks the usage of keyword arguments in Sidekiq workers.
Constant Summary collapse
- MSG =
"Avoid keyword arguments in workers"
- OBSERVED_METHOD =
:perform
Instance Method Summary collapse
Instance Method Details
#on_def(node) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rubocop/cop/netlify/sidekiq_keyword_arguments.rb', line 18 def on_def(node) return if node.method_name != OBSERVED_METHOD node.arguments.each do |argument| if keyword_argument?(argument) add_offense(node, location: :expression) break end end end |