Chef/Deprecations/SearchUsesPositionalParameters
The Cookstyle cops department: Chef/Deprecations
| Enabled by default | Supports autocorrection | Target Chef Version |
|---|---|---|
| Enabled | Yes | All Versions |
In the cookbook search helper you need to use named parameters (key/value style) other than the first (type) and second (query string) values.
Examples
# bad
search(:node, '*:*', 0, 1000, { :ip_address => ["ipaddress"] })
search(:node, '*:*', 0, 1000)
search(:node, '*:*', 0)
# good
search(:node, '*:*', start: 0, rows: 1000, filter_result: { :ip_address => ["ipaddress"] })
search(:node, '*:*', start: 0, rows: 1000)
search(:node, '*:*', start: 0)
Configurable attributes
| Name | Default value | Configurable values |
|---|---|---|
| Version Added | 5.11.0 | String |
| Include | Array |