Skip to main content

Chef/Modernize/RespondToCompileTime

Cookstyle cops page

The Cookstyle cops department: Chef/Modernize

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYes12.1+

There is no need to check if the chef_gem resource supports compile_time as Chef Infra Client 12.1 and later support the compile_time property.

Examples

incorrect

chef_gem 'ultradns-sdk' do
  compile_time true if Chef::Resource::ChefGem.method_defined?(:compile_time)
  action :nothing
end

chef_gem 'ultradns-sdk' do
  compile_time true if Chef::Resource::ChefGem.instance_methods(false).include?(:compile_time)
  action :nothing
end

chef_gem 'ultradns-sdk' do
  compile_time true if respond_to?(:compile_time)
  action :nothing
end

correct

chef_gem 'ultradns-sdk' do
  compile_time true
  action :nothing
end

Configurable attributes

NameDefault valueConfigurable values
Version Added6.3.0String
Include
    Array

    Thank you for your feedback!

    ×









    Search Results