Skip to main content

Chef/Modernize/UseChefLanguageEnvHelpers

Cookstyle cops page

The Cookstyle cops department: Chef/Modernize

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYes15.5+

Chef Infra Client 15.5 and later include a large number of new helpers in the Chef Infra Language to simplify checking the system configuration in recipes and resources. These should be used when possible over more complex attributes or ENV var comparisons.

Examples

incorrect

ENV['CI']
ENV['TEST_KITCHEN']

correct

ci?
kitchen?

Configurable attributes

NameDefault valueConfigurable values
Version Added7.21.0String
Include
  • **/resources/*.rb
  • **/providers/*.rb
  • **/recipes/*.rb
Array

Thank you for your feedback!

×