Class: RuboCop::Cop::Chef::Deprecations::SearchUsesPositionalParameters
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Chef::Deprecations::SearchUsesPositionalParameters
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb
Overview
In the cookbook search helper you need to use named parameters (key/value style) other than the first (type) and second (query string) values.
Constant Summary collapse
- MSG =
"Don't use deprecated positional parameters in cookbook search queries."- RESTRICT_ON_SEND =
[:search].freeze
- NAMED_PARAM_LOOKUP_TABLE =
[nil, nil, 'start', 'rows', 'filter_result'].freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_send(node) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb', line 48 def on_send(node) search_method?(node) do add_offense(node, severity: :warning) do |corrector| corrector.replace(node, corrected_string(node)) end if positional_arguments?(node) end end |