Chef/RedundantCode/MultiplePlatformChecks
The Cookstyle cops department: Chef/RedundantCode
Enabled by default | Supports autocorrection | Target Chef Version |
---|---|---|
Enabled | Yes | All Versions |
You can pass multiple values to the platform? and platform_family? helpers instead of calling the helpers multiple times.
Examples
incorrect
platform?('redhat') || platform?('ubuntu')
platform_family?('debian') || platform_family?('rhel')
correct
platform?('redhat', 'ubuntu')
platform_family?('debian', 'rhel')
Configurable attributes
Name | Default value | Configurable values |
---|---|---|
Version Added | 6.10.0 | String |
Include | Array |