Chef/Modernize/CustomResourceWithAttributes
The Cookstyle cops department: Chef/Modernize
Enabled by default | Supports autocorrection | Target Chef Version |
---|---|---|
Enabled | Yes | All Versions |
In HWRPs and LWRPs you defined attributes, but custom resources changed the name to be properties to avoid confusion with chef recipe attributes. When writing a custom resource they should be called properties even though the two are aliased.
Examples
incorrect
attribute :something, String
action :create do
# some action code because we're in a custom resource
end
correct
property :something, String
action :create do
# some action code because we're in a custom resource
end
Configurable attributes
Name | Default value | Configurable values |
---|---|---|
Version Added | 5.2.0 | String |
Include |
| Array |