cookstyle 7.31.9 → 7.32.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77ad4617e8e89f4b34622dfc962e39037e28c5d9779cbc3198a64c7155b426ed
4
- data.tar.gz: cf9fdce4231a1b0c55e8166628affc51abe3eb188ba5a8d75c08cd57f0d49470
3
+ metadata.gz: e2f55c6b537df4ecc7cbab6b05962b36bfdd2be1de9c9aa2a4a75169ca6c1e03
4
+ data.tar.gz: e2266d2ad7aca19c04cabe83df4f471b0226f85ec472d63bde5cf0232b327ed7
5
5
  SHA512:
6
- metadata.gz: db4d6bf2c6a01d8bbd4c49f3ed8a13cf23b70d664f15c515536ae64e509af4d2caa6151825161d9dc554d19088527465b009e37ff13fbac1a04829308fb90684
7
- data.tar.gz: 192f218ee77783b63d7712a0c51837c2a50ebffef4cf1f12112cfcd0008599e9bdf25fb6250f7f4f2c2206f15ae856ef62a6ee2183abb8cb86ad959823df98f6
6
+ metadata.gz: 44ca2ad6f132101f59e22c8c3b92e417a63836b37f916176cec3bdebd2bdd3547ec2ea7377b1f6f59a82a33f6e722964755583812a378ed8c4ca178a2475a96c
7
+ data.tar.gz: 93286dc94bd04076ab103582a3b18bce4d0ff814876aa39283d96e279ad08febdc17da6d6267f7d93c8f01f92c4e7102ff90124b6162474020545c7b8cc6a7c4
data/config/cookstyle.yml CHANGED
@@ -8,6 +8,7 @@ AllCops:
8
8
  Include:
9
9
  - '**/.delivery/project.toml' # required by Chef/Deprecations/Delivery
10
10
  - '**/.delivery/config.json' # required by Chef/Deprecations/Delivery
11
+ - '**/.foodcritic'
11
12
  Exclude:
12
13
  - '**/files/**/*'
13
14
  - '**/vendor/**/*'
@@ -1222,6 +1223,14 @@ Chef/Deprecations/FoodcriticTesting:
1222
1223
  - '**/Rakefile'
1223
1224
  - '**/Gemfile'
1224
1225
 
1226
+ Chef/Deprecations/FoodcriticFile:
1227
+ Description: The Foodcritic cookbook linter has been deprecated and should no longer be used for validating cookbooks
1228
+ StyleGuide: 'chef_deprecations_foodcriticfile'
1229
+ Enabled: true
1230
+ VersionAdded: '7.32.0'
1231
+ Include:
1232
+ - '**/.foodcritic'
1233
+
1225
1234
  Chef/Deprecations/DeprecatedYumRepositoryActions:
1226
1235
  Description: With the release of Chef Infra Client 12.14 and the yum cookbook 3.0 several actions in the yum_repository resource actions were renamed. The `add` action became `create` and `delete` became `remove` to better match other resources in Chef Infra Client.
1227
1236
  StyleGuide: 'chef_deprecations_deprecatedyumrepositoryactions'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Cookstyle
3
- VERSION = "7.31.9" # rubocop: disable Style/StringLiterals
3
+ VERSION = "7.32.0" # rubocop: disable Style/StringLiterals
4
4
  RUBOCOP_VERSION = '1.25.1'
5
5
  end
@@ -25,12 +25,12 @@ module RuboCop
25
25
  #
26
26
  # #### incorrect
27
27
  # platform?('darwin')
28
- # platform?('rhel)
28
+ # platform?('rhel')
29
29
  # platform?('sles')
30
30
  #
31
31
  # #### correct
32
32
  # platform?('mac_os_x')
33
- # platform?('redhat)
33
+ # platform?('redhat')
34
34
  # platform?('suse')
35
35
  #
36
36
  class InvalidPlatformHelper < Base
@@ -27,14 +27,14 @@ module RuboCop
27
27
  # ChefDK::CLI
28
28
  # ChefDK::Generator::TemplateHelper
29
29
  # module ChefDK
30
- # ...
30
+ # # some additional code
31
31
  # end
32
32
  #
33
33
  # #### correct
34
34
  # ChefCLI::CLI
35
35
  # ChefCLI::Generator::TemplateHelper
36
36
  # module ChefCLI
37
- # ...
37
+ # # some additional code
38
38
  # end
39
39
  #
40
40
  class ChefDKGenerators < Base
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Copyright:: 2022, Chef Software Inc.
4
+ # Author:: Tim Smith (<tsmith84@gmail.com>)
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ module RuboCop
19
+ module Cop
20
+ module Chef
21
+ module Deprecations
22
+ # The Foodcritic cookbook linter has been deprecated and should no longer be used for validating cookbooks. Do not include the `.foodcritic` config file used by Foodcritic in your cookbooks.
23
+ #
24
+ class FoodcriticFile < Base
25
+ include RangeHelp
26
+
27
+ MSG = 'Do not include the `.foodcritic` config file for the deprecated Foodcritic cookbook linter.'
28
+
29
+ def on_new_investigation
30
+ return unless processed_source.path.end_with?('.foodcritic')
31
+
32
+ # Using range similar to RuboCop::Cop::Naming::Filename (file_name.rb)
33
+ range = source_range(processed_source.buffer, 1, 0)
34
+
35
+ add_offense(range, severity: :warning)
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -30,7 +30,7 @@ module RuboCop
30
30
  #
31
31
  # #### correct
32
32
  # action :foo do
33
- # converge_by('resource did something) do
33
+ # converge_by('resource did something') do
34
34
  # # code that causes the resource to converge
35
35
  # end
36
36
  #
@@ -28,7 +28,8 @@ module RuboCop
28
28
  # class MyCookbookService < Chef::Resource
29
29
  # use_automatic_resource_name
30
30
  # provides :mycookbook_service
31
- # ...
31
+ #
32
+ # # some additional code
32
33
  # end
33
34
  # end
34
35
  #
@@ -33,6 +33,8 @@ module RuboCop
33
33
  #
34
34
  # # check to see if we're on RHEL 7 on a RHEL 7.6 node where node['platform_version] is 7.6.1810
35
35
  # if node['platform_version'].to_i == 7
36
+ # # some code
37
+ # end
36
38
  #
37
39
  class SimplifyPlatformMajorVersionCheck < Base
38
40
  extend AutoCorrector
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module InSpec
21
21
  module Deprecations
22
- # The InSpec inputs `default` option has been replaced with the `value` option.
22
+ # The Chef InSpec inputs `default` option has been replaced with the `value` option.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module InSpec
21
21
  module Deprecations
22
- # InSpec attributes have been renamed to inputs. Use the `input` method not the deprecation `attribute` method to access these values.
22
+ # Chef InSpec attributes have been renamed to inputs. Use the `input` method not the deprecation `attribute` method to access these values.
23
23
  #
24
24
  # @example
25
25
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookstyle
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.31.9
4
+ version: 7.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom May
@@ -124,6 +124,7 @@ files:
124
124
  - lib/rubocop/cop/chef/deprecation/erl_call.rb
125
125
  - lib/rubocop/cop/chef/deprecation/execute_path_property.rb
126
126
  - lib/rubocop/cop/chef/deprecation/execute_relative_creates_without_cwd.rb
127
+ - lib/rubocop/cop/chef/deprecation/foodcritic_file.rb
127
128
  - lib/rubocop/cop/chef/deprecation/foodcritic_testing.rb
128
129
  - lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb
129
130
  - lib/rubocop/cop/chef/deprecation/hwrp_without_unified_mode_true.rb