Skip to content

Commit

Permalink
Bump version to 6.2.0 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 Mar 30, 2020
1 parent afa9857 commit d4f9c58
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 5 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Cookstyle Changelog

<!-- latest_release -->
<!-- latest_release 6.2.0 -->
## [v6.2.0](https://github.com/chef/cookstyle/tree/v6.2.0) (2020-03-30)

#### Merged Pull Requests
- Add ChefRedundantCode/UseCreateIfMissing cop [#595](https://github.com/chef/cookstyle/pull/595) ([tas50](https://github.com/tas50))
<!-- latest_release -->

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

#### Merged Pull Requests
- Add ChefRedundantCode/UseCreateIfMissing cop [#595](https://github.com/chef/cookstyle/pull/595) ([tas50](https://github.com/tas50)) <!-- 6.2.0 -->
<!-- release_rollup -->

<!-- latest_stable_release -->
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 **184 Chef Infra 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 **185 Chef Infra 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 @@
6.1.6
6.2.0
1 change: 1 addition & 0 deletions docs/cops.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
* [ChefRedundantCode/SuggestsMetadata](cops_chefredundantcode.md#chefredundantcodesuggestsmetadata)
* [ChefRedundantCode/UnnecessaryDesiredState](cops_chefredundantcode.md#chefredundantcodeunnecessarydesiredstate)
* [ChefRedundantCode/UnnecessaryNameProperty](cops_chefredundantcode.md#chefredundantcodeunnecessarynameproperty)
* [ChefRedundantCode/UseCreateIfMissing](cops_chefredundantcode.md#chefredundantcodeusecreateifmissing)

#### Department [ChefSharing](cops_chefsharing.md)

Expand Down
37 changes: 37 additions & 0 deletions docs/cops_chefredundantcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,3 +506,40 @@ Name | Default value | Configurable values
VersionAdded | `5.8.0` | String
VersionChanged | `5.15.0` | String
Include | `**/resources/*.rb`, `**/libraries/*.rb` | Array

## ChefRedundantCode/UseCreateIfMissing

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

Use the :create_if_missing action instead of not_if with a ::File.exist(FOO) check.

### Examples

```ruby
# bad
cookbook_file '/logs/foo/error.log' do
source 'error.log'
owner 'root'
group 'root'
mode '0644'
not_if { ::File.exists?('/logs/foo/error.log') }
end

# good
cookbook_file '/logs/foo/error.log' do
source 'error.log'
owner 'root'
group 'root'
mode '0644'
action :create_if_missing
end
```

### Configurable attributes

Name | Default value | Configurable values
--- | --- | ---
VersionAdded | `6.2.0` | String
Exclude | `**/metadata.rb`, `**/attributes/*.rb`, `**/Berksfile` | Array
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 = "6.1.6".freeze # rubocop: disable Style/StringLiterals
VERSION = "6.2.0".freeze # rubocop: disable Style/StringLiterals
RUBOCOP_VERSION = '0.80.1'.freeze
end

0 comments on commit d4f9c58

Please sign in to comment.