Skip to content

Commit

Permalink
Add release notes for Cookstyle 5.5
Browse files Browse the repository at this point in the history
Add the release notes for this week's release.

Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Sep 6, 2019
1 parent fd07b43 commit eaf1222
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 4 deletions.
75 changes: 75 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,87 @@

#### Chef/ResourceSetsInternalProperties

The `ResourceSetsInternalProperties` cop detects resources that set internal state properties used by built in Chef Infra resources. These undocumented properties should not be set in a resource block and doing so will cause unexpected behavior when running Chef Infra Client.

`Examples`

Service resource setting the running property:
```ruby
service 'foo' do
running true
action [:start, :enable]
end
```

#### Chef/ResourceSetsNameProperty

The `ResourceSetsNameProperty` cop detects a resource block with the `name` property set. The `name` property is a special property that is derviced from the name of the resource block and should not be changed with the block. Changing the name within a resource block can cause issues with reporting and notifications. If you wish to give your resources a more friendly name consider setting using setting a `name_property` which is available in all built-in Chef Infra resources. The name_property for each resource can be found in the [resource reference documentation](https://docs.chef.io/resource_reference.html)

`Examples`

Service resource incorrectly setting the name property:
```ruby
service 'Start the important service' do
name 'foo'
action [:start, :enable]
end
```

Service resource correctly setting the service_name name property:
```ruby
service 'Start the important service' do
service_name 'foo'
action [:start, :enable]
end
```

`Enabled by default`: True

`Autocorrects`: No

#### Chef/ResourceWithNoneAction

The `ResourceWithNoneAction` cop detects the use of the `:none` action in a resource. The `:none` action is a common typo for the built-in `:nothing` action in all resources.

`Examples`

Service resource with the incorrect :none action:
```ruby
service 'my_service' do
action [:none]
end
```

`Enabled by default`: True

`Autocorrects`: Yes

#### Chef/ChocolateyPackageUninstallAction

The `ChocolateyPackageUninstallAction` cop detects a `chocolatey_package` resource that uses the `:uninstall` action. The uninstall action has been replaced with the `:remove` action and will error in Chef Infra Client 14+

`Examples`

chocolatey_package incorrectly setting the :uninstall action:

```ruby
chocolatey_package 'nginx' do
action :uninstall
end
```

chocolatey_package correctly setting the :remove action:

```ruby
chocolatey_package 'nginx' do
action :remove
end
```

`Enabled by default`: True

`Autocorrects`: Yes

#### Chef/LaunchdDeprecatedHashProperty

#### Chef/LocaleDeprecatedLcAllProperty
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ module Chef
# supports 'darwin'
# supports 'mswin'
#
#
# # good
# supports 'mac_os_x'
# supports 'windows'
#

class InvalidPlatformMetadata < Cop
COMMON_TYPOS = {
"aws": nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ module Chef
#
# @example
#
#
# # bad
# property :config_file, String, required: true, name_property: true
#
#
# # good
# property :config_file, String, required: true
#
class NamePropertyIsRequired < Cop
MSG = 'Resource properties marked as name properties should not also be required properties'.freeze

Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/chef/correctness/node_save.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module Chef
#
# # bad
# node.save
#
class CookbookUsesNodeSave < Cop
MSG = "Don't use node.save to save partial node data to the Chef Infra Server mid-run unless it's absolutely necessary. Node.save can result in failed Chef Infra runs appearing in search and increases load on the Chef Infra Server.".freeze

Expand Down

0 comments on commit eaf1222

Please sign in to comment.