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

Name Default value Configurable values
Version Added 5.12.0 String
Include
  • **/resources/*.rb
  • **/libraries/*.rb
Array

Was this page helpful?

×









Search Results