Class: RuboCop::Cop::Chef::ChefDeprecations::LocaleDeprecatedLcAllProperty

Inherits:
RuboCop::Cop
  • Object
show all
Includes:
RuboCop::Chef::CookbookHelpers
Defined in:
lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb

Overview

The local resource’s lc_all property has been deprecated and will be removed in Chef Infra Client 16

Examples:


# bad
locale 'set locale' do
  lang 'en_gb.utf-8'
  lc_all 'en_gb.utf-8'
end

Constant Summary collapse

MSG =
"The local resource's lc_all property has been deprecated and will be removed in Chef Infra Client 16".freeze

Instance Method Summary collapse

Methods included from RuboCop::Chef::CookbookHelpers

#match_property_in_resource?, #match_resource_type?, #method_arg_ast_to_string, #resource_block_name_if_string

Instance Method Details

#on_block(node) ⇒ Object



36
37
38
39
40
# File 'lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb', line 36

def on_block(node)
  match_property_in_resource?(:locale, 'lc_all', node) do |property|
    add_offense(property, location: :expression, message: MSG, severity: :refactor)
  end
end