Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cookstyle 6.1 release notes #593

Merged
merged 8 commits into from
Mar 27, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
## Cookstyle 6.1

### 5 New 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. The simpler `node.role?('foo')` helper should be used instead.
tas50 marked this conversation as resolved.
Show resolved Hide resolved

`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` detects resources that use Ruby code to shellout in not_if and only_if conditionals when they can just shellout without the additional complexity of Ruby.
tas50 marked this conversation as resolved.
Show resolved Hide resolved

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/IncludeResourceDescriptions` cop detects resource properties that don't include a description value. The description in resources properties are used by the `chef-resource-inspector` command and can be used to automatically generate documentation.
tas50 marked this conversation as resolved.
Show resolved Hide resolved
tas50 marked this conversation as resolved.
Show resolved Hide resolved

`Enabled by default`: False

`Autocorrects`: No

#### ChefSharing/IncludeResourceDescriptions

The `ChefSharing/IncludeResourceDescriptions` cop detects resource that don't include a description. The description in resources is used by the `chef-resource-inspector` command and can be used to automatically generate documentation.
tas50 marked this conversation as resolved.
Show resolved Hide resolved
tas50 marked this conversation as resolved.
Show resolved Hide resolved

`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.

## Cookstyle 6.0

### RuboCop 0.80.1 Engine
Expand Down