cookstyle 7.30.3 → 7.31.3

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: 94be7df501ab0a3a055ee36aab695764830d816e3db7005a7b18231d3a703505
4
- data.tar.gz: 3cf466a2d3fec655c473df01a769bb9e577359ed04ea3569f6cc6fb0f5c59ea0
3
+ metadata.gz: ef76b0aec4f125de72a07fdb9aac1e079b6ff6b873dff89d3e9ee1665a153843
4
+ data.tar.gz: 8d8332cf3c6c991fb7b483fc4de82e73cd47f4834304e105b624da6649c9845b
5
5
  SHA512:
6
- metadata.gz: 339ccca52365ef809d5976ceadcea5ead13bcef57b294725a26d0f6e5ddfb306f1e003c72d1fd99448640018f0da00d4188ea48adfda39593b2cc02cc541d95e
7
- data.tar.gz: d02e13fed47f62938a3e3f3dd07c86c8873294bd9fbb96395534f33419b62084a2814581717c8540db139668a67657e009bb3060432a553b111e99c1d0830bc5
6
+ metadata.gz: e61f510b819dd0b81019a78e49ab6794b63890bc4e8940c39db6a2170fdbf28ca2b4d610eabd78ed0fe8d804eea66b746701f64927a82775c2fcab37cdd449dd
7
+ data.tar.gz: a0d25d86e1db04309786f376ea6ea3733d14be8e85651e7764879770ba3f28339bf99e7385c2ffc0144d03089886a6458e69c9bab8e9f29eff09731daf615a4a
data/config/cookstyle.yml CHANGED
@@ -12,6 +12,7 @@ AllCops:
12
12
  ###############################
13
13
 
14
14
  Chef/Style:
15
+ Enabled: true
15
16
  StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
16
17
 
17
18
  Chef/Style/AttributeKeys:
@@ -156,6 +157,7 @@ Chef/Style/IncludeRecipeWithParentheses:
156
157
  ###############################
157
158
 
158
159
  Chef/Correctness:
160
+ Enabled: true
159
161
  StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
160
162
 
161
163
  Chef/Correctness/ServiceResource:
@@ -529,6 +531,7 @@ Chef/Correctness/InvalidNotificationResource:
529
531
  ###############################
530
532
 
531
533
  Chef/Sharing:
534
+ Enabled: true
532
535
  StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
533
536
 
534
537
  Chef/Sharing/InsecureCookbookURL:
@@ -597,6 +600,7 @@ Chef/Sharing/IncludeResourceExamples:
597
600
  ###############################
598
601
 
599
602
  Chef/Deprecations:
603
+ Enabled: true
600
604
  StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
601
605
 
602
606
  Chef/Deprecations/NodeDeepFetch:
@@ -1260,6 +1264,14 @@ Chef/Deprecations/PolicyfileCommunitySource:
1260
1264
  Include:
1261
1265
  - '**/Policyfile.rb'
1262
1266
 
1267
+ Chef/Deprecations/Delivery:
1268
+ Description: Do not include a `.delivery` directory for the `delivery` command in your cookbooks. Chef Delivery (Workflow) went EOL Dec 31st 2021 and the delivery command was removed from Chef Workstation Feb 2022.
1269
+ StyleGuide: 'chef_deprecations_delivery'
1270
+ Enabled: true
1271
+ VersionAdded: '7.31.0'
1272
+ Include:
1273
+ - '**/metadata.rb'
1274
+
1263
1275
  Chef/Deprecations/DeprecatedSudoActions:
1264
1276
  Description: The `sudo` resource in the sudo cookbook 5.0 (2018) or Chef Infra Client 14 and later have replaced the existing `:install` and `:remove` actions with `:create` and `:delete` actions to better match other resources in Chef Infra.
1265
1277
  StyleGuide: 'chef_deprecations_deprecatedsudoactions'
@@ -1301,6 +1313,7 @@ Chef/Deprecations/DependsOnOmnibusUpdaterCookbook:
1301
1313
  ###############################
1302
1314
 
1303
1315
  Chef/Modernize:
1316
+ Enabled: true
1304
1317
  StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
1305
1318
 
1306
1319
  Chef/Modernize/LegacyBerksfileSource:
@@ -1973,6 +1986,7 @@ Chef/Modernize/DeclareActionClass:
1973
1986
  ###############################
1974
1987
 
1975
1988
  Chef/RedundantCode:
1989
+ Enabled: true
1976
1990
  StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
1977
1991
 
1978
1992
  Chef/RedundantCode/ConflictsMetadata:
@@ -2195,6 +2209,7 @@ Chef/RedundantCode/DoubleCompileTime:
2195
2209
  ###############################
2196
2210
 
2197
2211
  Chef/Effortless:
2212
+ Enabled: true
2198
2213
  StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
2199
2214
 
2200
2215
  Chef/Effortless/CookbookUsesSearch:
data/config/upstream.yml CHANGED
@@ -430,13 +430,13 @@ Layout/ClassStructure:
430
430
  - prepend
431
431
  - extend
432
432
  ExpectedOrder:
433
- - module_inclusion
434
- - constants
435
- - public_class_methods
436
- - initializer
437
- - public_methods
438
- - protected_methods
439
- - private_methods
433
+ - module_inclusion
434
+ - constants
435
+ - public_class_methods
436
+ - initializer
437
+ - public_methods
438
+ - protected_methods
439
+ - private_methods
440
440
 
441
441
  Layout/ClosingHeredocIndentation:
442
442
  Description: 'Checks the indentation of here document closings.'
@@ -1900,7 +1900,7 @@ Lint/NestedPercentLiteral:
1900
1900
  VersionAdded: '0.52'
1901
1901
 
1902
1902
  Lint/NextWithoutAccumulator:
1903
- Description: >-
1903
+ Description: >-
1904
1904
  Do not omit the accumulator when calling `next`
1905
1905
  in a `reduce`/`inject` block.
1906
1906
  Enabled: true
@@ -3153,7 +3153,7 @@ Style/ClassMethodsDefinitions:
3153
3153
  StyleGuide: '#def-self-class-methods'
3154
3154
  Enabled: false
3155
3155
  VersionAdded: '0.89'
3156
- EnforcedStyle: def_self
3156
+ EnforcedStyle: def_self
3157
3157
  SupportedStyles:
3158
3158
  - def_self
3159
3159
  - self_class
@@ -3815,8 +3815,8 @@ Style/InverseMethods:
3815
3815
  :>: :<=
3816
3816
  # `ActiveSupport` defines some common inverse methods. They are listed below,
3817
3817
  # and not enabled by default.
3818
- #:present?: :blank?,
3819
- #:include?: :exclude?
3818
+ # :present?: :blank?,
3819
+ # :include?: :exclude?
3820
3820
  # `InverseBlocks` are methods that are inverted by inverting the return
3821
3821
  # of the block that is passed to the method
3822
3822
  InverseBlocks:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Cookstyle
3
- VERSION = "7.30.3" # rubocop: disable Style/StringLiterals
4
- RUBOCOP_VERSION = '1.25.0'
3
+ VERSION = "7.31.3" # rubocop: disable Style/StringLiterals
4
+ RUBOCOP_VERSION = '1.25.1'
5
5
  end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Copyright:: 2022, Chef Software Inc.
4
+ # Author:: Tim Smith (<tsmith@chef.io>)
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 Delivery CLI from Chef Delivery/Workflow is no longer bundled with Chef Workstation as Chef Delivery is end of life as of Dec 31st 2021.
23
+ #
24
+ # Users of Delivery / Workflow would include a `.delivery` directory in their cookbooks. This directory would include Delivery local-mode configs
25
+ # or Delivery cookbooks. The contents of this directory are now obsolete and should be removed.
26
+ #
27
+ class Delivery < Base
28
+ include RangeHelp
29
+
30
+ MSG = 'Do not include a `.delivery` directory for the `delivery` command in your cookbooks. Chef Delivery (Workflow) went EOL Dec 31st 2021 and the delivery command was removed from Chef Workstation Feb 2022.'
31
+
32
+ def on_new_investigation
33
+ return unless File.exist?(File.join(File.dirname(processed_source.path) + '/.delivery'))
34
+
35
+ # Using range similar to RuboCop::Cop::Naming::Filename (file_name.rb)
36
+ range = source_range(processed_source.buffer, 1, 0)
37
+
38
+ add_offense(range, severity: :warning)
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright:: 2020, Chef Software Inc.
3
+ # Copyright:: 2020-2022, Chef Software Inc.
4
4
  # Author:: Tim Smith (<tsmith@chef.io>)
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,6 +34,7 @@ module RuboCop
34
34
  DEPRECATED_MAPPING = {
35
35
  'amazon' => {
36
36
  '2017.12' => '2',
37
+ '> 2010' => true,
37
38
  },
38
39
  'aix' => {
39
40
  '~> 6' => true,
@@ -46,15 +47,15 @@ module RuboCop
46
47
  '> 16.04, < 18.04' => true,
47
48
  },
48
49
  'fedora' => {
49
- '< 31' => '31',
50
+ '< 32' => '32',
50
51
  },
51
52
  'freebsd' => {
52
- '~> 11.0, < 11.2' => '11',
53
53
  '= 12.0' => '12',
54
- '< 11' => true,
54
+ '< 12' => true,
55
55
  },
56
56
  'mac_os_x' => {
57
57
  '< 10.14' => '10.15',
58
+ ' = 11.0' => '11',
58
59
  },
59
60
  'suse' => {
60
61
  '~> 12.0, < 12.4' => '12',
@@ -67,17 +68,17 @@ module RuboCop
67
68
  },
68
69
  'debian' => {
69
70
  '< 9' => true,
70
- '> 9.0, < 9.11' => '9',
71
+ '> 9.0, < 9.12' => '9',
71
72
  },
72
73
  'centos' => {
73
74
  '< 6.0' => true,
74
75
  '~> 6.0, < 6.10' => '6',
75
- '~> 7.0, < 7.7 ' => '7',
76
+ '~> 7.0, < 7.8 ' => '7',
76
77
  },
77
78
  'redhat' => {
78
79
  '< 6.0' => true,
79
80
  '~> 6.0, < 6.10' => '6',
80
- '~> 7.0, < 7.7' => '7',
81
+ '~> 7.0, < 7.8' => '7',
81
82
  },
82
83
  'oracle' => {
83
84
  '< 6.0' => true,
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright:: 2020, Chef Software, Inc.
3
+ # Copyright:: 2020-2022, Chef Software, Inc.
4
4
  # Author:: Tim Smith (<tsmith@chef.io>)
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -48,6 +48,10 @@ module RuboCop
48
48
  # action :delete
49
49
  # end
50
50
  #
51
+ # file "/etc/cron.d/#{job_name}" do
52
+ # action :delete
53
+ # end
54
+ #
51
55
  # #### correct
52
56
  # cron_d 'backup' do
53
57
  # minute '1'
@@ -70,14 +74,19 @@ module RuboCop
70
74
  def_node_matcher :file_or_template?, <<-PATTERN
71
75
  (block
72
76
  (send nil? {:template :file :cookbook_file}
73
- (str $_))
77
+ $(...))
74
78
  ...
75
79
  )
76
80
  PATTERN
77
81
 
78
82
  def on_block(node)
79
83
  file_or_template?(node) do |file_name|
80
- return unless file_name.start_with?('/etc/cron.d/')
84
+ # weed out types we can't evaluate
85
+ return unless file_name.dstr_type? || file_name.str_type?
86
+
87
+ # weed out string values that aren't a cron.d file
88
+ return unless file_name.value.start_with?('/etc/cron.d/')
89
+
81
90
  add_offense(node, severity: :refactor)
82
91
  end
83
92
  end
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.30.3
4
+ version: 7.31.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom May
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-18 00:00:00.000000000 Z
12
+ date: 2022-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubocop
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 1.25.0
20
+ version: 1.25.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 1.25.0
27
+ version: 1.25.1
28
28
  description:
29
29
  email:
30
30
  - thom@chef.io
@@ -103,6 +103,7 @@ files:
103
103
  - lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb
104
104
  - lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb
105
105
  - lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb
106
+ - lib/rubocop/cop/chef/deprecation/delivery.rb
106
107
  - lib/rubocop/cop/chef/deprecation/depends_chef_nginx_cookbook.rb
107
108
  - lib/rubocop/cop/chef/deprecation/depends_chef_reporting_cookbook.rb
108
109
  - lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb