Skip to main content

Chef/Modernize/PropertyWithNameAttribute

Cookstyle cops page

The Cookstyle cops department: Chef/Modernize

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYesAll Versions

When using properties in a custom resource you should use name_property not the legacy name_attribute from the days of attributes

Examples

incorrect

property :bob, String, name_attribute: true

correct

property :bob, String, name_property: true

Configurable attributes

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

Thank you for your feedback!

×










Search Results