Class: RuboCop::Cop::Chef::Deprecations::UsesDeprecatedMixins
- Extended by:
- AutoCorrector
- Includes:
- RangeHelp
- Defined in:
- lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb
Overview
Don’t use deprecated Mixins no longer included in Chef Infra Client 14 and later.
Constant Summary collapse
- MSG =
"Don't use deprecated Mixins no longer included in Chef Infra Client 14 and later."
- RESTRICT_ON_SEND =
[:include, :require].freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_send(node) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb', line 55 def on_send(node) deprecated_mixin?(node) do add_offense(node, severity: :warning) do |corrector| corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left)) end end deprecated_dsl?(node) do add_offense(node, severity: :warning) do |corrector| corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left)) end end dsl_mixin_require?(node) do add_offense(node, severity: :warning) do |corrector| corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left)) end end end |