Skip to content

Commit

Permalink
Bump version to 5.16.8 by Chef Expeditor
Browse files Browse the repository at this point in the history
Obvious fix; these changes are the result of automation not creative thinking.
  • Loading branch information
Chef Expeditor committed Dec 16, 2019
1 parent 6ee5abc commit 12fe272
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 9 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Cookstyle Changelog

<!-- latest_release 5.16.7 -->
## [v5.16.7](https://github.com/chef/cookstyle/tree/v5.16.7) (2019-12-16)
<!-- latest_release 5.16.8 -->
## [v5.16.8](https://github.com/chef/cookstyle/tree/v5.16.8) (2019-12-16)

#### Merged Pull Requests
- Speed up Cookstyle by excluding more files [#460](https://github.com/chef/cookstyle/pull/460) ([tas50](https://github.com/tas50))
- Add 5 new cops for the 5.16 release [#462](https://github.com/chef/cookstyle/pull/462) ([tas50](https://github.com/tas50))
<!-- latest_release -->

<!-- release_rollup since=5.15.7 -->
### Changes not yet released to rubygems.org

#### Merged Pull Requests
- Add 5 new cops for the 5.16 release [#462](https://github.com/chef/cookstyle/pull/462) ([tas50](https://github.com/tas50)) <!-- 5.16.8 -->
- Speed up Cookstyle by excluding more files [#460](https://github.com/chef/cookstyle/pull/460) ([tas50](https://github.com/tas50)) <!-- 5.16.7 -->
- Add ChefCorrectness/DnfPackageAllowDowngrades [#452](https://github.com/chef/cookstyle/pull/452) ([tas50](https://github.com/tas50)) <!-- 5.16.6 -->
- Add ChefCorrectness/MalformedPlatformValueForPlatformHelper cop [#459](https://github.com/chef/cookstyle/pull/459) ([tas50](https://github.com/tas50)) <!-- 5.16.5 -->
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

Cookstyle is a [code linting](https://en.wikipedia.org/wiki/Lint_%28software%29) tool that helps you to write better Chef Infra cookbooks by detecting and automatically correcting style, syntax, and logic mistakes in your code.

Cookstyle is powered by the [RuboCop](http://www.rubocop.org) linting engine. RuboCop ships with over three-hundred rules, or cops, designed to detect common Ruby coding mistakes and enforce a common coding style. We've customized Cookstyle with a subset of those cops that we believe are perfectly tailored for cookbook development. We also ship **148 Chef specific cops** that catch common cookbook coding mistakes, cleanup portions of code that are no longer necessary, and detect deprecations that prevent cookbooks from running on the latest releases of Chef Infra Client.
Cookstyle is powered by the [RuboCop](http://www.rubocop.org) linting engine. RuboCop ships with over three-hundred rules, or cops, designed to detect common Ruby coding mistakes and enforce a common coding style. We've customized Cookstyle with a subset of those cops that we believe are perfectly tailored for cookbook development. We also ship **153 Chef specific cops** that catch common cookbook coding mistakes, cleanup portions of code that are no longer necessary, and detect deprecations that prevent cookbooks from running on the latest releases of Chef Infra Client.

For a complete list of Cookstyle rules see the [Cops Documentation](https://github.com/chef/cookstyle/blob/master/docs/cops.md)

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.16.7
5.16.8
5 changes: 5 additions & 0 deletions docs/cops.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
* [ChefModernize/DependsOnZypperCookbook](cops_chefmodernize.md#chefmodernizedependsonzyppercookbook)
* [ChefModernize/EmptyResourceInitializeMethod](cops_chefmodernize.md#chefmodernizeemptyresourceinitializemethod)
* [ChefModernize/ExecuteAptUpdate](cops_chefmodernize.md#chefmodernizeexecuteaptupdate)
* [ChefModernize/ExecuteScExe](cops_chefmodernize.md#chefmodernizeexecutescexe)
* [ChefModernize/ExecuteSleep](cops_chefmodernize.md#chefmodernizeexecutesleep)
* [ChefModernize/ExecuteTzUtil](cops_chefmodernize.md#chefmodernizeexecutetzutil)
* [ChefModernize/FoodcriticComments](cops_chefmodernize.md#chefmodernizefoodcriticcomments)
* [ChefModernize/IfProvidesDefaultAction](cops_chefmodernize.md#chefmodernizeifprovidesdefaultaction)
Expand Down Expand Up @@ -127,6 +129,7 @@
* [ChefModernize/UseBuildEssentialResource](cops_chefmodernize.md#chefmodernizeusebuildessentialresource)
* [ChefModernize/UsesZypperRepo](cops_chefmodernize.md#chefmodernizeuseszypperrepo)
* [ChefModernize/WhyRunSupportedTrue](cops_chefmodernize.md#chefmodernizewhyrunsupportedtrue)
* [ChefModernize/WindowsScResource](cops_chefmodernize.md#chefmodernizewindowsscresource)
* [ChefModernize/WindowsVersionHelper](cops_chefmodernize.md#chefmodernizewindowsversionhelper)
* [ChefModernize/WindowsZipfileUsage](cops_chefmodernize.md#chefmodernizewindowszipfileusage)
* [ChefModernize/ZipfileResource](cops_chefmodernize.md#chefmodernizezipfileresource)
Expand All @@ -145,6 +148,7 @@
* [ChefRedundantCode/ResourceWithNothingAction](cops_chefredundantcode.md#chefredundantcoderesourcewithnothingaction)
* [ChefRedundantCode/SensitivePropertyInResource](cops_chefredundantcode.md#chefredundantcodesensitivepropertyinresource)
* [ChefRedundantCode/SuggestsMetadata](cops_chefredundantcode.md#chefredundantcodesuggestsmetadata)
* [ChefRedundantCode/UnnecessaryDesiredState](cops_chefredundantcode.md#chefredundantcodeunnecessarydesiredstate)
* [ChefRedundantCode/UnnecessaryNameProperty](cops_chefredundantcode.md#chefredundantcodeunnecessarynameproperty)

#### Department [ChefSharing](cops_chefsharing.md)
Expand All @@ -164,6 +168,7 @@
* [ChefStyle/FileMode](cops_chefstyle.md#chefstylefilemode)
* [ChefStyle/ImmediateNotificationTiming](cops_chefstyle.md#chefstyleimmediatenotificationtiming)
* [ChefStyle/SimplifyPlatformMajorVersionCheck](cops_chefstyle.md#chefstylesimplifyplatformmajorversioncheck)
* [ChefStyle/TrueClassFalseClassResourceProperties](cops_chefstyle.md#chefstyletrueclassfalseclassresourceproperties)
* [ChefStyle/UnnecessaryPlatformCaseStatement](cops_chefstyle.md#chefstyleunnecessaryplatformcasestatement)
* [ChefStyle/UsePlatformHelpers](cops_chefstyle.md#chefstyleuseplatformhelpers)

Expand Down
86 changes: 84 additions & 2 deletions docs/cops_chefmodernize.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,62 @@ Name | Default value | Configurable values
VersionAdded | `5.3.0` | String
Exclude | `**/metadata.rb` | Array

## ChefModernize/ExecuteScExe

Enabled by default | Supports autocorrection
--- | ---
Disabled | No

Chef Infra Client 14.0 and later includes :create, :delete, and :configure actions with the full idempotency of the windows_service resource. See the windows_service documentation at https://docs.chef.io/resource_windows_service.html for additional details on creating services with the windows_service resource.

# bad
execute "Delete chef-client service" do
command "sc.exe delete chef-client"
action :run
end

# good
windows_service 'chef-client' do
action :delete
end

### Configurable attributes

Name | Default value | Configurable values
--- | --- | ---
VersionAdded | `5.16.0` | String
Exclude | `**/metadata.rb`, `**/attributes/*.rb`, `**/Berksfile` | Array

## ChefModernize/ExecuteSleep

Enabled by default | Supports autocorrection
--- | ---
Disabled | No

Chef Infra Client 15.5 and later include a chef_sleep resource that should be used to sleep between executing resources if necessary instead of using the bash or execute resources to run the sleep command.

# bad
execute "sleep 60" do
command "sleep 60"
action :run
end

bash 'sleep' do
user 'root'
cwd '/tmp'
code 'sleep 60'
end

# good
chef_sleep '60'

### Configurable attributes

Name | Default value | Configurable values
--- | --- | ---
VersionAdded | `5.16.0` | String
Exclude | `**/metadata.rb`, `**/attributes/*.rb`, `**/Berksfile` | Array

## ChefModernize/ExecuteTzUtil

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -341,8 +397,7 @@ Enabled by default | Supports autocorrection
--- | ---
Enabled | No

Don't include the apt default recipe to update apt's package cache when you can
use the apt_update resource built into Chef Infra Client 12.7 and later.
For many users the apt::default cookbook is used only to update apt's package cache. Chef Infra Client 12.7 and later include an apt_update resource which should be used to perform this instead. Keep in mind that some users will want to stick with the apt::default recipe as it also installs packages necessary for using https repositories on Debian systems and manages some configuration files.

### Examples

Expand Down Expand Up @@ -1120,6 +1175,33 @@ Name | Default value | Configurable values
VersionAdded | `5.1.0` | String
Include | `**/resources/*.rb`, `**/providers/*.rb`, `**/libraries/*.rb` | Array

## ChefModernize/WindowsScResource

Enabled by default | Supports autocorrection
--- | ---
Disabled | No

The sc_windows resource from the sc cookbook allowed for the creation of windows services on legacy Chef Infra Client releases. Chef Infra Client 14.0 and later includes :create, :delete, and :configure actions without the need for additional cookbook dependencies. See the windows_service documentation at https://docs.chef.io/resource_windows_service.html for additional details on creating services with the windows_service resource.

# bad
sc_windows 'chef-client' do
path "C:\\opscode\\chef\\bin"
action :create
end

# good
windows_service 'chef-client' do
action :create
binary_path_name "C:\\opscode\\chef\\bin"
end

### Configurable attributes

Name | Default value | Configurable values
--- | --- | ---
VersionAdded | `5.16.0` | String
Exclude | `**/metadata.rb`, `**/attributes/*.rb`, `**/Berksfile` | Array

## ChefModernize/WindowsVersionHelper

Enabled by default | Supports autocorrection
Expand Down
24 changes: 23 additions & 1 deletion docs/cops_chefredundantcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ Enabled | Yes
Every Chef Infra resources already include a sensitive property with a default value of false.

# bad
property :sensitive, [TrueClass, FalseClass], default: false
property :sensitive, [true, false], default: false

### Configurable attributes

Expand Down Expand Up @@ -323,6 +323,28 @@ VersionAdded | `5.1.0` | String
VersionChanged | `5.15.0` | String
Include | `**/metadata.rb` | Array

## ChefRedundantCode/UnnecessaryDesiredState

Enabled by default | Supports autocorrection
--- | ---
Enabled | Yes

There is no need to set a property to desired_state: true as all properties have a desired_state of true by default.

### Examples

```ruby
# bad
property :foo, String, desired_state: true
```

### Configurable attributes

Name | Default value | Configurable values
--- | --- | ---
VersionAdded | `5.16.0` | String
Include | `**/resources/*.rb`, `**/libraries/*.rb` | Array

## ChefRedundantCode/UnnecessaryNameProperty

Enabled by default | Supports autocorrection
Expand Down
25 changes: 25 additions & 0 deletions docs/cops_chefstyle.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,31 @@ Name | Default value | Configurable values
VersionAdded | `5.8.0` | String
Exclude | `**/metadata.rb`, `**/Berksfile` | Array

## ChefStyle/TrueClassFalseClassResourceProperties

Enabled by default | Supports autocorrection
--- | ---
Enabled | Yes

When setting the allowed types for a resource to accept either true or false values it's much simpler to use true and false instead of TrueClass and FalseClass.

### Examples

```ruby
# bad
property :foo, [TrueClass, FalseClass]

# good
property :foo, [true, false]
```

### Configurable attributes

Name | Default value | Configurable values
--- | --- | ---
VersionAdded | `5.16.0` | String
Include | `**/libraries/*.rb`, `**/resources/*.rb` | Array

## ChefStyle/UnnecessaryPlatformCaseStatement

Enabled by default | Supports autocorrection
Expand Down
2 changes: 1 addition & 1 deletion lib/cookstyle/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Cookstyle
VERSION = "5.16.7".freeze # rubocop: disable Style/StringLiterals
VERSION = "5.16.8".freeze # rubocop: disable Style/StringLiterals
RUBOCOP_VERSION = '0.75.1'.freeze
end

0 comments on commit 12fe272

Please sign in to comment.