Skip to main content

IfProvidesDefaultAction

All Cookstyle Cops


The department is: Chef/Modernize

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


Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYesAll Versions

if defined?(default_action) is no longer necessary in Chef Resources as default_action shipped in Chef 10.8.

Examples

incorrect

default_action :foo if defined?(default_action)

correct

default_action :foo

Configurable attributes

NameDefault valueConfigurable values
Version Added5.12.0String
Include
  • **/resources/*.rb
  • **/libraries/*.rb
Array

Was this page helpful?