Skip to main content

Chef/Deprecations/SearchUsesPositionalParameters

Cookstyle cops page

The Cookstyle cops department: Chef/Deprecations

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYesAll 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

NameDefault valueConfigurable values
Version Added5.11.0String
Include
    Array

    Thank you for your feedback!

    ×