Chef/Correctness/PropertyWithoutType
The Cookstyle cops department: Chef/Correctness
| Enabled by default | Supports autocorrection | Target Chef Version |
|---|---|---|
| Enabled | No | All Versions |
Resource properties or attributes should always define a type to help users understand the correct allowed values.
Examples
# bad
property :size, regex: /^\d+[KMGTP]$/
attribute :size, regex: /^\d+[KMGTP]$/
# good
property :size, String, regex: /^\d+[KMGTP]$/
attribute :size, kind_of: String, regex: /^\d+[KMGTP]$/
Configurable attributes
| Name | Default value | Configurable values |
|---|---|---|
| Version Added | 6.18.0 | String |
| Include |
| Array |