Skip to main content

SearchForEnvironmentsOrRoles

All Cookstyle Cops


The department is: Chef/Effortless

The full name of the cop is: Chef/Effortless/SearchForEnvironmentsOrRoles


Enabled by defaultSupports autocorrectionTarget Chef Version
Not EnabledNoAll Versions

Policyfiles (and Effortless) do not use environments or roles so searching for those will need to be refactored before migrating to Policyfiles and the Effortless pattern.

Examples

incorrect

search(:node, 'chef_environment:foo')
search(:node, 'role:bar')

Configurable attributes

NameDefault valueConfigurable values
Version Added5.11.0String
Exclude
  • **/metadata.rb
  • **/Berksfile
Array

Was this page helpful?