Skip to main content

Chef/Modernize/IfProvidesDefaultAction

Cookstyle cops page

The Cookstyle cops department: Chef/Modernize

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