# Cookstyle 6.1.6 released with 5 new Chef cops!

**URL:** <https://discourse.chef.io/t/cookstyle-6-1-6-released-with-5-new-chef-cops/16861>\
**Category:** Chef Release Announcements\
**Created:** [March 27, 2020, 5:28pm UTC](https://discourse.chef.io/t/cookstyle-6-1-6-released-with-5-new-chef-cops/16861 "2020-03-27T17:28:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tas50](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tas50/32/941_2.png) [@tas50](https://discourse.chef.io/u/tas50)\
**Post date:** [March 27, 2020, 5:28pm UTC](https://discourse.chef.io/t/cookstyle-6-1-6-released-with-5-new-chef-cops/16861/1 "2020-03-27T17:28:18Z")

</div>

Hey everyone,

This week's new release of Cookstyle is out with 5 new Chef Infra cops bringing our total to 184 Chef Infra specific cops!

#### ChefModernize/NodeRolesInclude

The `ChefModernize/NodeRolesInclude` cop detects cookbooks that use `node['roles'].include?('foo')` to see if a particular role has been applied to a node. Use the simpler `node.role?('foo')` helper instead.

`Enabled by default`: True

`Autocorrects`: Yes

#### ChefDeprecations/PowershellCookbookHelpers

The `ChefDeprecations/PowershellCookbookHelpers` cop detects cookbooks that use the deprecated `Powershell::VersionHelper.powershell_version?` helper from the `powershell` cookbook. Chef Infra Client provides information on the installed PowerShell release at `node['powershell']['version']` and Chef Infra Client 15.8 and later includes a new `powershell_version` method which should be used when possible.

`Enabled by default`: True

`Autocorrects`: Yes

#### ChefCorrectness/ConditionalRubyShellout

The `ChefCorrectness/ConditionalRubyShellout` cop detects resources that use unnecessary Ruby code in `not_if` and `only_if` conditionals to shellout when a string can be used to avoid additional complexity.

Shelling out with ruby:

```ruby
cookbook_file '/logs/foo/error.log' do
  only_if { system('wget https://www.bar.com/foobar.txt -O /dev/null') }
end

```

Shelling out without Ruby:

```ruby
cookbook_file '/logs/foo/error.log' do
  only_if 'wget https://www.bar.com/foobar.txt -O /dev/null'
end

```

`Enabled by default`: True

`Autocorrects`: Yes

#### ChefSharing/IncludePropertyDescriptions

The `ChefSharing/IncludePropertyDescriptions` cop detects resource properties that don't include a description value. The `chef-resource-inspector` command displays the description value in resource properties and that description can be used to automatically generate documentation.

`Enabled by default`: False

`Autocorrects`: No

#### ChefSharing/IncludeResourceDescriptions

The `ChefSharing/IncludeResourceDescriptions` cop detects resources that don't include a description. The `chef-resource-inspector` command displays the description value in resources and that description can be used to automatically generate documentation.

`Enabled by default`: False

`Autocorrects`: No

### Other Changes

- `ChefModernize/PowershellInstallWindowsFeature` now correctly identifies the required Chef Infra Client release as 14.0 and later.
- The `WindowsVersionHelper` cop has been moved to the `ChefDeprecations` department and now includes autocorrection for each of the helpers it identifies.

Enjoy,  
Tim
