Skip to main content

UseChefLanguageEnvHelpers

The department is: UseChefLanguageEnvHelpers

The full name of the cop is: Chef/Modernize/UseChefLanguageEnvHelpers

Enabled by default Supports autocorrection Target Chef Version
Enabled Yes 15.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

Name Default value Configurable values
Version Added 7.21.0 String
Include
  • **/resources/*.rb
  • **/providers/*.rb
  • **/recipes/*.rb
Array

Was this page helpful?

×









Search Results