Class: RuboCop::Cop::Chef::Deprecations::Ruby27KeywordArgumentWarnings
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb
Overview
Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
Constant Summary collapse
- MSG =
'Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.'
- RESTRICT_ON_SEND =
[:shell_out!, :shell_out].freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_send(node) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb', line 44 def on_send(node) positional_shellout?(node) do |h| next unless h.braces? add_offense(h, severity: :refactor) do |corrector| corrector.replace(h, h.source[1..-2]) end end end |