Skip to main content

IfProvidesDefaultAction

The department is: IfProvidesDefaultAction

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

Thank you for your feedback!

×









Search Results