Class: RuboCop::Cop::Sidekiq::UnknownSidekiqOption

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/sidekiq/unknown_sidekiq_option.rb

Overview

Checks for unknown or unsupported options passed to sidekiq_options.

Examples:

# bad
sidekiq_options priorty: :high
sidekiq_options unique: true

# good
sidekiq_options queue: :critical, retry: 5

Constant Summary collapse

MSG =
'Unknown or unsupported Sidekiq option `%<option>s` in `sidekiq_options`.'
ALLOWED_OPTIONS =
%w[queue retry dead backtrace pool tags].freeze

Instance Method Summary collapse

Methods included from Sidekiq::Language

#active_job_class?, #perform_call?, #sidekiq_include?, #sidekiq_options_call?

Instance Method Details

#on_send(node) ⇒ Object Also known as: on_csend



21
22
23
24
25
26
27
# File 'lib/rubocop/cop/sidekiq/unknown_sidekiq_option.rb', line 21

def on_send(node)
  sidekiq_options_call?(node) do |args|
    args.each do |arg|
      check_options_hash(arg)
    end
  end
end