Skip to main content

Chef/Correctness/PropertyWithoutType

Cookstyle cops page

The Cookstyle cops department: Chef/Correctness

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledNoAll Versions

Resource properties or attributes should always define a type to help users understand the correct allowed values.

Examples

incorrect

property :size, regex: /^\d+[KMGTP]$/
attribute :size, regex: /^\d+[KMGTP]$/

correct

property :size, String, regex: /^\d+[KMGTP]$/
attribute :size, kind_of: String, regex: /^\d+[KMGTP]$/

Configurable attributes

NameDefault valueConfigurable values
Version Added6.18.0String
Include
  • **/libraries/*.rb
  • **/resources/*.rb
Array

Thank you for your feedback!

×











Search Results