SetOrReturnInResources
The department is: SetOrReturnInResources
The full name of the cop is: Chef/Modernize/SetOrReturnInResources
Enabled by default | Supports autocorrection | Target Chef Version |
---|---|---|
Enabled | No | All Versions |
set_or_return within a method should not be used to define property in a resource. Instead use the property method which properly validates and defines properties in a way that works with reporting and documentation functionality in Chef Infra Client
Examples
incorrect
def severity(arg = nil)
set_or_return(
:severity, arg,
:kind_of => String,
:default => nil
)
end
correct
property :severity, String
Configurable attributes
Name | Default value | Configurable values |
---|---|---|
Version Added | 5.2.0 | String |
Include |
| Array |