cookstyle 7.8.3 → 7.11.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/config/cookstyle.yml +10 -9
  3. data/config/disable_all.yml +10 -0
  4. data/config/upstream.yml +60 -3
  5. data/cookstyle.gemspec +1 -1
  6. data/lib/cookstyle.rb +1 -1
  7. data/lib/cookstyle/version.rb +2 -2
  8. data/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +2 -2
  9. data/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +1 -1
  10. data/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb +1 -1
  11. data/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb +1 -1
  12. data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +1 -1
  13. data/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb +1 -1
  14. data/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb +1 -1
  15. data/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +1 -1
  16. data/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb +2 -1
  17. data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +1 -1
  18. data/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +1 -1
  19. data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb +1 -1
  20. data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb +1 -1
  21. data/lib/rubocop/cop/chef/correctness/node_normal.rb +2 -6
  22. data/lib/rubocop/cop/chef/correctness/node_normal_unless.rb +2 -6
  23. data/lib/rubocop/cop/chef/correctness/node_save.rb +1 -3
  24. data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +1 -1
  25. data/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb +1 -1
  26. data/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb +1 -3
  27. data/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb +1 -1
  28. data/lib/rubocop/cop/chef/correctness/tmp_path.rb +1 -1
  29. data/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb +2 -2
  30. data/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +1 -1
  31. data/lib/rubocop/cop/chef/deprecation/chef_rest.rb +1 -1
  32. data/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +2 -2
  33. data/lib/rubocop/cop/chef/deprecation/chef_shellout.rb +2 -4
  34. data/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb +1 -1
  35. data/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb +1 -1
  36. data/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb +1 -1
  37. data/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +1 -1
  38. data/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb +1 -1
  39. data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +1 -1
  40. data/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +1 -1
  41. data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +1 -1
  42. data/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb +1 -1
  43. data/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb +1 -1
  44. data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_actions.rb +1 -1
  45. data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +1 -1
  46. data/lib/rubocop/cop/chef/deprecation/easy_install.rb +1 -1
  47. data/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb +2 -2
  48. data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +2 -2
  49. data/lib/rubocop/cop/chef/deprecation/erl_call.rb +1 -1
  50. data/lib/rubocop/cop/chef/deprecation/{ use_automatic_resource_name.rb → use_automatic_resource_name.rb} +0 -0
  51. data/lib/rubocop/cop/chef/style/unnecessary_os_check.rb +1 -1
  52. data/lib/rubocop/monkey_patches/{comment_config.rb → directive_comment.rb} +5 -4
  53. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e04dd24b5b97c48a31e63a92a6d333c5c43bc4a4548d7f478a1568c3a6852f04
4
- data.tar.gz: c03fcc110f131b4d0d4d094d13e8d3f7027c3f995d19e9b31f7ef37308e112e8
3
+ metadata.gz: 2da2b22b8cbec39156ae6f213739615fac386c943b19062270624f49733692eb
4
+ data.tar.gz: e294eddf92cf044629ad569af5f2cef1775044c599952a546529212e79bceb45
5
5
  SHA512:
6
- metadata.gz: 85afba2dca8cf6626f58c7cb42ce79f2e9b41c9f2e4eef8833988130d1cb4376de34942ad8fb4337271f5c4b6b15f5e32f31443620227c719379f993850dd34d
7
- data.tar.gz: a4a02a5e22bdd2b39d2b867c7a669a24fb4b324558ed6073971674f1155323736aac2bb1446fa73e0c073b6e84a36a96a6c0986d1e027feb73fcd4ec9f953c18
6
+ metadata.gz: cf63786305a68c636fabd90f597b8f11e3936cf70180899435d3a520d45227fdfd007fe862facbe7a584413bcf6d00b8cc43fa3a56ec7ef986a96a5f7b798673
7
+ data.tar.gz: fef011328aae08ad9bf62a8f6b772da9a20e28baa8ef1c4fbcdd251269a9d62f2e15df1f79794c1fc84fcfb7c4c341fad910ff1e2689a4446a763fae254f889b
data/config/cookstyle.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  AllCops:
2
2
  SuggestExtensions: false
3
- TargetRubyVersion: 2.4
3
+ TargetRubyVersion: 2.5
4
4
  TargetChefVersion: ~
5
5
  Exclude:
6
6
  - '/**/files/**/*'
@@ -221,7 +221,7 @@ Chef/Correctness/MetadataMissingName:
221
221
  - '**/metadata.rb'
222
222
 
223
223
  Chef/Correctness/BlockGuardWithOnlyString:
224
- Description: A resource guard (not_if/only_if) that is a string should not be wrapped in {}. Wrapping a guard string in {} causes it to be executed as Ruby code which will always returns true instead of a shell command that will actually run.
224
+ Description: A resource guard (not_if/only_if) that is a string should not be wrapped in {}. Wrapping a guard string in {} causes it to be executed as Ruby code which will always return true instead of a shell command that will actually run.
225
225
  StyleGuide: 'chef_correctness_blockguardwithonlystring'
226
226
  Enabled: true
227
227
  VersionAdded: '5.2.0'
@@ -584,7 +584,7 @@ Chef/Deprecations/NodeSetUnless:
584
584
  - '**/Berksfile'
585
585
 
586
586
  Chef/Deprecations/EpicFail:
587
- Description: Use ignore_failure method instead of the deprecated epic_fail method
587
+ Description: Use `ignore_failure` in resources to continue when failures occur instead of the deprecated `epic_fail` property
588
588
  StyleGuide: 'chef_deprecations_epicfail'
589
589
  Enabled: true
590
590
  VersionAdded: '5.1.0'
@@ -843,7 +843,7 @@ Chef/Deprecations/DeprecatedYumRepositoryProperties:
843
843
  - '**/Berksfile'
844
844
 
845
845
  Chef/Deprecations/EOLAuditModeUsage:
846
- Description: The beta Audit Mode feature in Chef Infra Client was removed in Chef Infra Client 15.0. Users should instead use InSpec and the audit cookbook. See https://www.inspec.io/ for more informmation.
846
+ Description: The beta Audit Mode feature in Chef Infra Client was removed in Chef Infra Client 15.0.
847
847
  StyleGuide: 'chef_deprecations_eolauditmodeusage'
848
848
  Enabled: true
849
849
  VersionAdded: '5.10.0'
@@ -905,7 +905,7 @@ Chef/Deprecations/PartialSearchClassUsage:
905
905
  - '**/metadata.rb'
906
906
 
907
907
  Chef/Deprecations/Cheffile:
908
- Description: The Libarian-Chef depsolving project is no longer maintained and should not be used for cookbook depsolving. Consider using Policyfiles instead.
908
+ Description: The Librarian-Chef depsolving project is no longer maintained and should not be used for cookbook depsolving. Consider using Policyfiles instead.
909
909
  StyleGuide: 'chef_deprecations_cheffile'
910
910
  Enabled: true
911
911
  VersionAdded: '5.12.0'
@@ -1071,7 +1071,7 @@ Chef/Deprecations/ChefDKGenerators:
1071
1071
  - '**/Berksfile'
1072
1072
 
1073
1073
  Chef/Deprecations/ChefHandlerRecipe:
1074
- Description: There is no need to include the empty and deprecated chef_handler::default recipe in order to use the chef_handler resource.
1074
+ Description: There is no need to include the empty and deprecated chef_handler::default recipe to use the chef_handler resource.
1075
1075
  StyleGuide: 'chef_deprecations_chefhandlerrecipe'
1076
1076
  Enabled: true
1077
1077
  VersionAdded: '6.12.0'
@@ -1107,7 +1107,7 @@ Chef/Deprecations/CookbooksDependsOnSelf:
1107
1107
  - '**/metadata.rb'
1108
1108
 
1109
1109
  Chef/Deprecations/ChefShellout:
1110
- Description: Don't use deprecated Chef::ShellOut which was removed in Chef Infra Client 13. Use Mixlib::ShellOut instead, which behaves identically.
1110
+ Description: Don't use the deprecated `Chef::ShellOut` class which was removed in Chef Infra Client 13. Use the `Mixlib::ShellOut` class instead, which behaves identically.
1111
1111
  StyleGuide: 'chef_deprecations_chefshellout'
1112
1112
  Enabled: true
1113
1113
  VersionAdded: '6.17.0'
@@ -2247,8 +2247,9 @@ Style/Proc:
2247
2247
  Enabled: true
2248
2248
  Style/RaiseArgs:
2249
2249
  Enabled: true
2250
+ # disabled for now as this breaks ruby_block resources
2250
2251
  Style/RedundantBegin:
2251
- Enabled: true
2252
+ Enabled: false
2252
2253
  Style/RedundantException:
2253
2254
  Enabled: true
2254
2255
  Style/RedundantFreeze:
@@ -2721,7 +2722,7 @@ Lint/BinaryOperatorWithIdenticalOperands:
2721
2722
  # Lint/TopLevelReturnWithArgument:
2722
2723
  # Enabled: true
2723
2724
 
2724
- # simplify hash acccess that doesn't actually need .dig
2725
+ # simplify hash access that doesn't actually need .dig
2725
2726
  Style/SingleArgumentDig:
2726
2727
  Enabled: true
2727
2728
 
@@ -5,6 +5,8 @@ Bundler/DuplicatedGem:
5
5
  Enabled: false
6
6
  Bundler/GemComment:
7
7
  Enabled: false
8
+ Bundler/GemVersion:
9
+ Enabled: false
8
10
  Bundler/InsecureProtocolSource:
9
11
  Enabled: false
10
12
  Bundler/OrderedGems:
@@ -147,8 +149,12 @@ Layout/MultilineOperationIndentation:
147
149
  Enabled: false
148
150
  Layout/ParameterAlignment:
149
151
  Enabled: false
152
+ Layout/RedundantLineBreak:
153
+ Enabled: false
150
154
  Layout/RescueEnsureAlignment:
151
155
  Enabled: false
156
+ Layout/SingleLineBlockChain:
157
+ Enabled: false
152
158
  Layout/SpaceAfterColon:
153
159
  Enabled: false
154
160
  Layout/SpaceAfterComma:
@@ -851,6 +857,8 @@ Style/StabbyLambdaParentheses:
851
857
  Enabled: false
852
858
  Style/StderrPuts:
853
859
  Enabled: false
860
+ Style/StringChars:
861
+ Enabled: false
854
862
  Style/StringConcatenation:
855
863
  Enabled: false
856
864
  Style/StringHashKeys:
@@ -897,6 +905,8 @@ Style/TrivialAccessors:
897
905
  Enabled: false
898
906
  Style/UnlessElse:
899
907
  Enabled: false
908
+ Style/UnlessLogicalOperators:
909
+ Enabled: false
900
910
  Style/UnpackFirst:
901
911
  Enabled: false
902
912
  Style/VariableInterpolation:
data/config/upstream.yml CHANGED
@@ -130,7 +130,7 @@ AllCops:
130
130
  # What MRI version of the Ruby interpreter is the inspected code intended to
131
131
  # run on? (If there is more than one, set this to the lowest version.)
132
132
  # If a value is specified for TargetRubyVersion then it is used. Acceptable
133
- # values are specificed as a float (i.e. 2.5); the teeny version of Ruby
133
+ # values are specificed as a float (i.e. 3.0); the teeny version of Ruby
134
134
  # should not be included. If the project specifies a Ruby version in the
135
135
  # .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
136
136
  # try to determine the desired version of Ruby by inspecting the
@@ -138,7 +138,7 @@ AllCops:
138
138
  # or gems.locked file. (Although the Ruby version is specified in the Gemfile
139
139
  # or gems.rb file, RuboCop reads the final value from the lock file.) If the
140
140
  # Ruby version is still unresolved, RuboCop will use the oldest officially
141
- # supported Ruby version (currently Ruby 2.4).
141
+ # supported Ruby version (currently Ruby 2.5).
142
142
  TargetRubyVersion: ~
143
143
  # Determines if a notification for extension libraries should be shown when
144
144
  # rubocop is run. Keys are the name of the extension, and values are an array
@@ -174,6 +174,20 @@ Bundler/GemComment:
174
174
  IgnoredGems: []
175
175
  OnlyFor: []
176
176
 
177
+ Bundler/GemVersion:
178
+ Description: 'Requires or forbids specifying gem versions.'
179
+ Enabled: false
180
+ VersionAdded: '1.14'
181
+ EnforcedStyle: 'required'
182
+ SupportedStyles:
183
+ - 'required'
184
+ - 'forbidden'
185
+ Include:
186
+ - '**/*.gemfile'
187
+ - '**/Gemfile'
188
+ - '**/gems.rb'
189
+ AllowedGems: []
190
+
177
191
  Bundler/InsecureProtocolSource:
178
192
  Description: >-
179
193
  The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
@@ -1101,11 +1115,24 @@ Layout/ParameterAlignment:
1101
1115
  # But it can be overridden by setting this parameter
1102
1116
  IndentationWidth: ~
1103
1117
 
1118
+ Layout/RedundantLineBreak:
1119
+ Description: >-
1120
+ Do not break up an expression into multiple lines when it fits
1121
+ on a single line.
1122
+ Enabled: false
1123
+ InspectBlocks: false
1124
+ VersionAdded: '1.13'
1125
+
1104
1126
  Layout/RescueEnsureAlignment:
1105
1127
  Description: 'Align rescues and ensures correctly.'
1106
1128
  Enabled: true
1107
1129
  VersionAdded: '0.49'
1108
1130
 
1131
+ Layout/SingleLineBlockChain:
1132
+ Description: 'Put method call on a separate line if chained to a single line block.'
1133
+ Enabled: false
1134
+ VersionAdded: '1.14'
1135
+
1109
1136
  Layout/SpaceAfterColon:
1110
1137
  Description: 'Use spaces after colons.'
1111
1138
  StyleGuide: '#spaces-operators'
@@ -1380,6 +1407,8 @@ Lint/AmbiguousBlockAssociation:
1380
1407
  StyleGuide: '#syntax'
1381
1408
  Enabled: true
1382
1409
  VersionAdded: '0.48'
1410
+ VersionChanged: '1.13'
1411
+ IgnoredMethods: []
1383
1412
 
1384
1413
  Lint/AmbiguousOperator:
1385
1414
  Description: >-
@@ -2055,13 +2084,18 @@ Lint/SuppressedException:
2055
2084
  StyleGuide: '#dont-hide-exceptions'
2056
2085
  Enabled: true
2057
2086
  AllowComments: true
2087
+ AllowNil: true
2058
2088
  VersionAdded: '0.9'
2059
- VersionChanged: '0.81'
2089
+ VersionChanged: '1.12'
2060
2090
 
2061
2091
  Lint/SymbolConversion:
2062
2092
  Description: 'Checks for unnecessary symbol conversions.'
2063
2093
  Enabled: pending
2064
2094
  VersionAdded: '1.9'
2095
+ EnforcedStyle: strict
2096
+ SupportedStyles:
2097
+ - strict
2098
+ - consistent
2065
2099
 
2066
2100
  Lint/Syntax:
2067
2101
  Description: 'Checks for syntax errors.'
@@ -2489,6 +2523,7 @@ Naming/MemoizedInstanceVariableName:
2489
2523
  - disallowed
2490
2524
  - required
2491
2525
  - optional
2526
+ Safe: false
2492
2527
 
2493
2528
  Naming/MethodName:
2494
2529
  Description: 'Use the configured style when naming methods.'
@@ -3174,6 +3209,7 @@ Style/Documentation:
3174
3209
  Description: 'Document classes and non-namespace modules.'
3175
3210
  Enabled: true
3176
3211
  VersionAdded: '0.9'
3212
+ AllowedConstants: []
3177
3213
  Exclude:
3178
3214
  - 'spec/**/*'
3179
3215
  - 'test/**/*'
@@ -3446,6 +3482,8 @@ Style/HashConversion:
3446
3482
  Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
3447
3483
  Enabled: pending
3448
3484
  VersionAdded: '1.10'
3485
+ VersionChanged: '1.11'
3486
+ AllowSplatArgument: true
3449
3487
 
3450
3488
  Style/HashEachMethods:
3451
3489
  Description: 'Use Hash#each_key and Hash#each_value.'
@@ -3670,6 +3708,7 @@ Style/MethodCallWithArgsParentheses:
3670
3708
  AllowParenthesesInMultilineCall: false
3671
3709
  AllowParenthesesInChaining: false
3672
3710
  AllowParenthesesInCamelCaseMethod: false
3711
+ AllowParenthesesInStringInterpolation: false
3673
3712
  EnforcedStyle: require_parentheses
3674
3713
  SupportedStyles:
3675
3714
  - require_parentheses
@@ -4489,6 +4528,13 @@ Style/StderrPuts:
4489
4528
  Enabled: true
4490
4529
  VersionAdded: '0.51'
4491
4530
 
4531
+ Style/StringChars:
4532
+ Description: 'Checks for uses of `String#split` with empty string or regexp literal argument.'
4533
+ StyleGuide: '#string-chars'
4534
+ Enabled: pending
4535
+ Safe: false
4536
+ VersionAdded: '1.12'
4537
+
4492
4538
  Style/StringConcatenation:
4493
4539
  Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
4494
4540
  StyleGuide: '#string-interpolation'
@@ -4586,6 +4632,7 @@ Style/SymbolProc:
4586
4632
  Safe: false
4587
4633
  VersionAdded: '0.26'
4588
4634
  VersionChanged: '1.5'
4635
+ AllowMethodsWithArguments: false
4589
4636
  # A list of method names to be ignored by the check.
4590
4637
  # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
4591
4638
  IgnoredMethods:
@@ -4738,6 +4785,16 @@ Style/UnlessElse:
4738
4785
  Enabled: true
4739
4786
  VersionAdded: '0.9'
4740
4787
 
4788
+ Style/UnlessLogicalOperators:
4789
+ Description: >-
4790
+ Checks for use of logical operators in an unless condition.
4791
+ Enabled: false
4792
+ VersionAdded: '1.11'
4793
+ EnforcedStyle: forbid_mixed_logical_operators
4794
+ SupportedStyles:
4795
+ - forbid_mixed_logical_operators
4796
+ - forbid_logical_operators
4797
+
4741
4798
  Style/UnpackFirst:
4742
4799
  Description: >-
4743
4800
  Checks for accessing the first element of `String#unpack`
data/cookstyle.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = 'Cookstyle is a code linting tool that helps you to write better Chef Infra cookbooks by detecting and automatically correcting style, syntax, and logic mistakes in your code.'
12
12
  spec.license = 'Apache-2.0'
13
13
  spec.homepage = 'https://docs.chef.io/workstation/cookstyle/'
14
- spec.required_ruby_version = '>= 2.4'
14
+ spec.required_ruby_version = '>= 2.5'
15
15
 
16
16
  # the gemspec and Gemfile are necessary for appbundling of the gem
17
17
  spec.files = %w(LICENSE cookstyle.gemspec Gemfile) + Dir.glob('{lib,bin,config}/**/*')
data/lib/cookstyle.rb CHANGED
@@ -7,7 +7,7 @@ require 'yaml' unless defined?(YAML)
7
7
  # ensure the desired target version of RuboCop is gem activated
8
8
  gem 'rubocop', "= #{Cookstyle::RUBOCOP_VERSION}"
9
9
  require 'rubocop'
10
- require_relative 'rubocop/monkey_patches/comment_config'
10
+ require_relative 'rubocop/monkey_patches/directive_comment'
11
11
 
12
12
  # monkey patches needed for the TargetChefVersion config option
13
13
  require_relative 'rubocop/monkey_patches/config'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Cookstyle
3
- VERSION = "7.8.3" # rubocop: disable Style/StringLiterals
4
- RUBOCOP_VERSION = '1.10.0'
3
+ VERSION = "7.11.3" # rubocop: disable Style/StringLiterals
4
+ RUBOCOP_VERSION = '1.14.0'
5
5
  end
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # A resource guard (not_if/only_if) that is a string should not be wrapped in {}. Wrapping a guard string in {} causes it to be executed as Ruby code which will always returns true instead of a shell command that will actually run.
22
+ # A resource guard (not_if/only_if) that is a string should not be wrapped in `{}`. Wrapping a guard string in {} causes it to be executed as Ruby code which will always return true instead of a shell command that will actually run.
23
23
  #
24
24
  # @example
25
25
  #
@@ -40,7 +40,7 @@ module RuboCop
40
40
  class BlockGuardWithOnlyString < Base
41
41
  extend AutoCorrector
42
42
 
43
- MSG = 'A resource guard (not_if/only_if) that is a string should not be wrapped in {}. Wrapping a guard string in {} causes it to be executed as Ruby code which will always returns true instead of a shell command that will actually run.'
43
+ MSG = 'A resource guard (not_if/only_if) that is a string should not be wrapped in {}. Wrapping a guard string in {} causes it to be executed as Ruby code which will always return true instead of a shell command that will actually run.'
44
44
 
45
45
  def_node_matcher :block_guard_with_only_string?, <<-PATTERN
46
46
  (block (send nil? ${:not_if :only_if}) (args) (str $_) )
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Use raise to force Chef Infra Client to fail instead of using Chef::Application.fatal, which masks the full stack trace of the failure and makes debugging difficult.
22
+ # Use `raise` to force Chef Infra Client to fail instead of using `Chef::Application.fatal`, which masks the full stack trace of the failure and makes debugging difficult.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Don't use Ruby to shellout in a only_if / not_if conditional when you can just shellout directly. Any string value used with only_if / not_if is executed in your system's shell and the return code of the command is the result for the not_if / only_if determination.
22
+ # Don't use Ruby to shellout in a `only_if` / `not_if` conditional. Any string value used in an `only_if` / `not_if` is executed in your system's shell and the return code of the command is the result for the `not_if` / `only_if` determination.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # dnf_package does not support the allow_downgrades property
22
+ # The `dnf_package` resource does not support the `allow_downgrades` property.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Libraries should be injected into the Chef::DSL::Recipe class and not Chef::Recipe or Chef::Provider classes directly.
22
+ # Libraries should be injected into the `Chef::DSL::Recipe` class and not `Chef::Recipe` or `Chef::Provider` classes directly.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Valid notification timings are :immediately, :immediate (alias for :immediately), :delayed, and :before.
22
+ # Valid notification timings are `:immediately`, `:immediate` (alias for :immediately), `:delayed`, and `:before`.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Pass valid platform families to the platform_family? helper.
22
+ # Pass valid platform families to the `platform_family?` helper. See [Infra Language: Platform Family](https://docs.chef.io/infra_language/checking_platforms/#platform_family-values) for a complete list of platform families.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Use valid platform family values in case statements.
22
+ # Use valid platform family values in case statements. See [Infra Language: Platform Family](https://docs.chef.io/infra_language/checking_platforms/#platform_family-values) for a complete list of platform families.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Pass valid platforms to the platform? helper.
22
+ # Pass valid platforms to the `platform?` helper. See [Infra Language: Platform](https://docs.chef.io/infra_language/checking_platforms/#platform-values) for a list of many common platform values.
23
23
  #
24
24
  # @example
25
25
  #
@@ -32,6 +32,7 @@ module RuboCop
32
32
  # platform?('mac_os_x')
33
33
  # platform?('redhat)
34
34
  # platform?('suse')
35
+ #
35
36
  class InvalidPlatformHelper < Base
36
37
  include ::RuboCop::Chef::PlatformHelpers
37
38
 
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Correctness
23
- # metadata.rb supports methods should contain valid platforms.
23
+ # metadata.rb `supports` methods should contain valid platforms. See [Infra Language: Platform](https://docs.chef.io/infra_language/checking_platforms/#platform-values) for a list of many common platform values.
24
24
  #
25
25
  # @example
26
26
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Use valid platform values in case statements.
22
+ # Use valid platform values in case statements. See [Infra Language: Platform](https://docs.chef.io/infra_language/checking_platforms/#platform-values) for a list of many common platform values.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Pass valid platforms families to the value_for_platform_family helper.
22
+ # Pass valid platform families to the value_for_platform_family helper. See [Infra Language: Platform Family](https://docs.chef.io/infra_language/checking_platforms/#platform_family-values) for a complete list of platform families.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Pass valid platforms to the value_for_platform helper.
22
+ # Pass valid platforms to the value_for_platform helper. See [Infra Language: Platform](https://docs.chef.io/infra_language/checking_platforms/#platform-values) for a list of many common platform values.
23
23
  #
24
24
  # @example
25
25
  #
@@ -18,13 +18,9 @@ module RuboCop
18
18
  module Cop
19
19
  module Chef
20
20
  module Correctness
21
- # Normal attributes are discouraged since their semantics differ importantly from the
22
- # default and override levels. Their values persist in the node object even after
23
- # all code referencing them has been deleted, unlike default and override.
21
+ # Normal attributes are discouraged since their semantics differ importantly from the default and override levels. Their values persist in the node object even after all code referencing them has been deleted, unlike default and override.
24
22
  #
25
- # Code should be updated to use default or override levels, but this will change
26
- # attribute merging behavior so needs to be validated manually and force_default or
27
- # force_override levels may need to be used in recipe code.
23
+ # Code should be updated to use default or override levels, but this will change attribute merging behavior so needs to be validated manually and force_default or force_override levels may need to be used in recipe code.
28
24
  #
29
25
  # @example
30
26
  #
@@ -18,13 +18,9 @@ module RuboCop
18
18
  module Cop
19
19
  module Chef
20
20
  module Correctness
21
- # Normal attributes are discouraged since their semantics differ importantly from the
22
- # default and override levels. Their values persist in the node object even after
23
- # all code referencing them has been deleted, unlike default and override.
21
+ # Normal attributes are discouraged since their semantics differ importantly from the default and override levels. Their values persist in the node object even after all code referencing them has been deleted, unlike default and override.
24
22
  #
25
- # Code should be updated to use default or override levels, but this will change
26
- # attribute merging behavior so needs to be validated manually and force_default or
27
- # force_override levels may need to be used in recipe code.
23
+ # Code should be updated to use default or override levels, but this will change attribute merging behavior so needs to be validated manually and force_default or force_override levels may need to be used in recipe code.
28
24
  #
29
25
  # @example
30
26
  #
@@ -19,9 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Don't use node.save to save partial node data to the Chef Infra Server mid-run unless it's
23
- # absolutely necessary. Node.save can result in failed Chef Infra runs appearing in search and
24
- # increases load on the Chef Infra Server."
22
+ # Don't use node.save to save partial node data to the Chef Infra Server mid-run unless it's a requirement of cookbook design that can't be avoided. Node.save can result in failed Chef Infra runs appearing in search and increases load on the Chef Infra Server."
25
23
  #
26
24
  # @example
27
25
  #
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Correctness
23
- # When notifying or subscribing an action within a resource the action should always be a symbol. In Chef Infra Client releases before 14.0 this may result in double notification.
23
+ # When notifying or subscribing actions within a resource the action should always be a symbol. In Chef Infra Client releases before 14.0, this may result in double notification.
24
24
  #
25
25
  # @example
26
26
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # The openSSL cookbook provides a deprecated `secure_password` helper in the `Opscode::OpenSSL::Password` class, which should not longer be used. This helper would generate a random password that would be used when a data bag or attribute was no present. The practice of generating passwords to be stored on the node is bad security as it exposes the password to anyone that can view the nodes, and deleting a node deletes the password. Passwords should be retrieved from a secure source for use in cookbooks.
22
+ # The OpenSSL cookbook provides a deprecated `secure_password` helper in the `Opscode::OpenSSL::Password` class, which should no longer be used. This helper would generate a random password that would be used when a data bag or attribute was no present. The practice of generating passwords to be stored on the node is bad security as it exposes the password to anyone that can view the nodes, and deleting a node deletes the password. Passwords should be retrieved from a secure source for use in cookbooks.
23
23
  #
24
24
  # #### incorrect
25
25
  # ::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)
@@ -19,9 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Chef Infra Client uses properties in several resources to track state. These
23
- # should not be set in recipes as they break the internal workings of the Chef
24
- # Infra Client
22
+ # Chef Infra Client uses properties in several resources to track state. These should not be set in recipes as they break the internal workings of the Chef Infra Client
25
23
  #
26
24
  # @example
27
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Scope file exist to access the correct File class by using ::File.exist? not File.exist?.
22
+ # Scope file exist to access the correct `File` class by using `::File.exist?` not `File.exist?`.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Correctness
22
- # Use file_cache_path rather than hard-coding tmp paths
22
+ # Use file_cache_path rather than hard-coding system temp paths
23
23
  #
24
24
  # @example downloading a large file into /tmp/
25
25
  #
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # There is no need to include the empty and deprecated chef_handler::default recipe in order to use the chef_handler resource
23
+ # There is no need to include the empty and deprecated chef_handler::default recipe to use the chef_handler resource
24
24
  #
25
25
  # @example
26
26
  #
@@ -32,7 +32,7 @@ module RuboCop
32
32
  include RangeHelp
33
33
  extend AutoCorrector
34
34
 
35
- MSG = 'There is no need to include the empty and deprecated chef_handler::default recipe in order to use the chef_handler resource'
35
+ MSG = 'There is no need to include the empty and deprecated chef_handler::default recipe to use the chef_handler resource'
36
36
  RESTRICT_ON_SEND = [:include_recipe].freeze
37
37
 
38
38
  def_node_matcher :chef_handler_recipe?, <<-PATTERN
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Use the type property instead of the deprecated supports property in the chef_handler resource. The supports property was removed in chef_handler cookbook version 3.0 (June 2017) and Chef Infra Client 14.0.
23
+ # Use the type `property` instead of the deprecated `supports` property in the `chef_handler` resource. The `supports` property was removed in `chef_handler` cookbook version 3.0 (June 2017) and Chef Infra Client 14.0.
24
24
  #
25
25
  # @example
26
26
  #
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Chef::REST was removed in Chef Infra Client 13.
23
+ # The `Chef::REST` class was removed in Chef Infra Client 13.
24
24
  #
25
25
  # @example
26
26
  #
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Use delete_resource / edit_resource introduced in Chef Infra Client 12.10 instead of functionality in the deprecated chef-rewind gem
23
+ # Use `delete_resource` or `edit_resource` helpers introduced in Chef Infra Client 12.10 instead of functionality in the deprecated `chef-rewind` gem
24
24
  #
25
25
  # @example
26
26
  #
@@ -48,7 +48,7 @@ module RuboCop
48
48
  unwind: 'delete_resource',
49
49
  }.freeze
50
50
 
51
- MSG = 'Use delete_resource / edit_resource introduced in Chef Infra Client 12.10 instead of functionality in the deprecated chef-rewind gem'
51
+ MSG = 'Use delete_resource or edit_resource helpers introduced in Chef Infra Client 12.10 instead of functionality in the deprecated chef-rewind gem'
52
52
  RESTRICT_ON_SEND = [:chef_gem, :require, :rewind, :unwind].freeze
53
53
 
54
54
  def_node_matcher :rewind_gem_install?, <<-PATTERN
@@ -20,9 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Don't use deprecated Chef::ShellOut which was removed in Chef Infra Client 13.
24
- # Use Mixlib::ShellOut instead, which behaves identically or convert to the shell_out
25
- # helper provided in chef-utils.
23
+ # Don't use the deprecated `Chef::ShellOut` class which was removed in Chef Infra Client 13. Use the `Mixlib::ShellOut` class instead, which behaves identically or convert to the simpler `shell_out` helper.
26
24
  #
27
25
  # @example
28
26
  #
@@ -40,7 +38,7 @@ module RuboCop
40
38
  include RangeHelp
41
39
  extend AutoCorrector
42
40
 
43
- MSG = "Don't use deprecated Chef::ShellOut which was removed in Chef Infra Client 13. Use Mixlib::ShellOut instead, which behaves identically."
41
+ MSG = "Don't use the deprecated `Chef::ShellOut` class which was removed in Chef Infra Client 13. Use the `Mixlib::ShellOut` class instead, which behaves identically."
44
42
  RESTRICT_ON_SEND = [:new, :require, :include].freeze
45
43
 
46
44
  def_node_matcher :include_shellout?, <<-PATTERN
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Chef Workstation 0.8 and later renamed the ChefDK module used when writing custom cookbook generators from ChefDK to ChefCLI. For compatibility with the latest Chef Workstation releases you'll need to reference the new class names.
23
+ # Chef Workstation 0.8 and later renamed the `ChefDK` module used when writing custom cookbook generators from `ChefDK` to `ChefCLI`. For compatibility with the latest Chef Workstation releases you'll need to reference the new class names.
24
24
  #
25
25
  # @example
26
26
  #
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Use ChefSpec::SoloRunner or ChefSpec::ServerRunner instead of the deprecated ChefSpec::Runner. These new runners were introduced in ChefSpec 4.1 (Oct 2014).
23
+ # Use `ChefSpec::SoloRunner` or `ChefSpec::ServerRunner` instead of the deprecated `ChefSpec::Runner`. These new runners were introduced in ChefSpec 4.1 (Oct 2014).
24
24
  #
25
25
  # @example
26
26
  #
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Use the :remove action in the chocolatey_package resource instead of :uninstall which was removed in Chef Infra Client 14+
23
+ # Use the `:remove` action in the `chocolatey_package` resource instead of `:uninstall` which was removed in Chef Infra Client 14+.
24
24
  #
25
25
  # @example
26
26
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Deprecations
22
- # Don't depend on the deprecated compat_resource cookbook made obsolete by Chef Infra Client 12.19+
22
+ # Don't depend on the deprecated `compat_resource` cookbook made obsolete by Chef Infra Client 12.19+.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Deprecations
22
- # Don't depend on the partial_search cookbook made obsolete by Chef Infra Client 13
22
+ # Don't depend on the `partial_search` cookbook made obsolete by Chef Infra Client 13.
23
23
  #
24
24
  # @example
25
25
  #
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Use currently supported platforms in ChefSpec listed at https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md. Fauxhai / ChefSpec will perform fuzzy matching on platform version so it's always best to be less specific ie. 10 instead of 10.3
23
+ # Use currently supported platforms in ChefSpec listed at https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md. Fauxhai / ChefSpec will perform fuzzy matching on platform version values so it's always best to be less specific ie. 10 instead of 10.3
24
24
  #
25
25
  # @example
26
26
  #
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Don't use deprecated Mixins no longer included in Chef Infra Client 14 and later
23
+ # Don't use deprecated Mixins no longer included in Chef Infra Client 14 and later.
24
24
  #
25
25
  # @example
26
26
  #
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Use provider_for_action or provides instead of the deprecated Chef::Platform methods in resources, which were removed in Chef Infra Client 13.
23
+ # Use `provider_for_action` or provides instead of the deprecated `Chef::Platform` methods in resources, which were removed in Chef Infra Client 13.
24
24
  #
25
25
  # @example
26
26
  #
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # The large number of shell_out helper methods in Chef Infra Client has been reduced to just shell_out and shell_out! methods. The legacy methods were removed in Chef Infra Client and cookbooks using these legacy helpers will need to be updated.
23
+ # The large number of `shell_out` helper methods in Chef Infra Client has been reduced to just `shell_out` and `shell_out!` methods. The legacy methods were removed in Chef Infra Client and cookbooks using these legacy helpers will need to be updated.
24
24
  #
25
25
  # @example
26
26
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Deprecations
22
- # Don't use the deprecated older_than_win_2012_or_8? helper. Windows versions before 2012 and 8 are now end of life and this helper will always return false.
22
+ # Don't use the deprecated `older_than_win_2012_or_8?` helper. Windows versions before 2012 and 8 are now end of life and this helper will always return false.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Deprecations
22
- # With the release of Chef Infra Client 12.14 and the yum cookbook 3.0 the actions 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.
22
+ # With the release of Chef Infra Client 12.14 and the yum cookbook 3.0 the actions 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.
23
23
  #
24
24
  # @example
25
25
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Deprecations
22
- # With the release of Chef Infra Client 12.14 and the yum cookbook 3.0 several properties in the yum_repository resource were renamed. url -> baseurl, keyurl -> gpgkey, and mirrorexpire -> mirror_expire.
22
+ # With the release of Chef Infra Client 12.14 and the yum cookbook 3.0 several properties in the `yum_repository` resource were renamed. `url` -> `baseurl`, `keyurl` -> `gpgkey`, and `mirrorexpire` -> `mirror_expire`.
23
23
  #
24
24
  # @example
25
25
  #
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Don't use the deprecated easy_install resource removed in Chef Infra Client 13
23
+ # Don't use the deprecated easy_install resource removed in Chef Infra Client 13.
24
24
  #
25
25
  # @example
26
26
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Deprecations
22
- # The beta Audit Mode for Chef Infra Client was removed in Chef Infra Client 15.0. Users should instead use InSpec and the audit cookbook. See https://www.inspec.io/ for more information.
22
+ # The beta Audit Mode for Chef Infra Client was removed in Chef Infra Client 15.0. Users should instead use InSpec and the audit cookbook or the Compliance Phase introduced in Chef Infra Client 17. See https://www.inspec.io/ for more information.
23
23
  #
24
24
  # @example
25
25
  #
@@ -33,7 +33,7 @@ module RuboCop
33
33
  # end
34
34
 
35
35
  class EOLAuditModeUsage < Base
36
- MSG = 'The beta Audit Mode feature in Chef Infra Client was removed in Chef Infra Client 15.0. Users should instead use InSpec and the audit cookbook. See https://www.inspec.io/ for more information.'
36
+ MSG = 'The beta Audit Mode feature in Chef Infra Client was removed in Chef Infra Client 15.0.'
37
37
  RESTRICT_ON_SEND = [:control_group].freeze
38
38
 
39
39
  def_node_matcher :control_group?, '(send nil? :control_group ...)'
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Make sure ignore_failure is used instead of epic_fail
23
+ # Use `ignore_failure` in resources to continue when failures occur instead of the deprecated `epic_fail` property.
24
24
  #
25
25
  # @example
26
26
  #
@@ -37,7 +37,7 @@ module RuboCop
37
37
  class EpicFail < Base
38
38
  extend AutoCorrector
39
39
 
40
- MSG = 'Use ignore_failure method instead of the deprecated epic_fail method'
40
+ MSG = 'Use `ignore_failure` in resources to continue when failures occur instead of the deprecated `epic_fail` property'
41
41
  RESTRICT_ON_SEND = [:epic_fail].freeze
42
42
 
43
43
  def on_send(node)
@@ -20,7 +20,7 @@ module RuboCop
20
20
  module Cop
21
21
  module Chef
22
22
  module Deprecations
23
- # Don't use the deprecated erl_call resource
23
+ # Don't use the deprecated `erl_call` resource removed in Chef Infra Client 13."
24
24
  #
25
25
  # @example
26
26
  #
@@ -19,7 +19,7 @@ module RuboCop
19
19
  module Cop
20
20
  module Chef
21
21
  module Style
22
- # Use the platform_family?() helpers instead of node['os] == 'foo' for platform_families that match one-to-one with OS values. These helpers are easier to read and can accept multiple platform arguments, which greatly simplifies complex platform logic. All values of `os` from Ohai match one-to-one with `platform_family` values except for `linux`, which has no single equivalent `plaform_family`.
22
+ # Use the platform_family?() helpers instead of node['os] == 'foo' for platform_families that match one-to-one with OS values. These helpers are easier to read and can accept multiple platform arguments, which greatly simplifies complex platform logic. All values of `os` from Ohai match one-to-one with `platform_family` values except for `linux`, which has no single equivalent `platform_family`.
23
23
  #
24
24
  # @example
25
25
  #
@@ -2,10 +2,11 @@
2
2
  module RuboCop
3
3
  # we're monkey patching the config regex to allow for # cookstyle: disable whatever
4
4
  # in addition to the # rubocop: disable whatever that comes with RuboCop
5
- class CommentConfig
6
- remove_const('COMMENT_DIRECTIVE_REGEXP')
7
- COMMENT_DIRECTIVE_REGEXP = Regexp.new(
8
- "# (?:rubocop|cookstyle): ((?:disable|enable|todo))\\b #{COPS_PATTERN}".gsub(' ', '\s*')
5
+ class DirectiveComment
6
+ remove_const('DIRECTIVE_COMMENT_REGEXP')
7
+ DIRECTIVE_COMMENT_REGEXP = Regexp.new(
8
+ "# (?:rubocop|cookstyle) : ((?:disable|enable|todo))\\b #{COPS_PATTERN}"
9
+ .gsub(' ', '\s*')
9
10
  )
10
11
  end
11
12
  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.8.3
4
+ version: 7.11.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: 2021-02-17 00:00:00.000000000 Z
12
+ date: 2021-05-06 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.10.0
20
+ version: 1.14.0
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.10.0
27
+ version: 1.14.0
28
28
  description:
29
29
  email:
30
30
  - thom@chef.io
@@ -85,7 +85,6 @@ files:
85
85
  - lib/rubocop/cop/chef/correctness/service_resource.rb
86
86
  - lib/rubocop/cop/chef/correctness/supports_must_be_float.rb
87
87
  - lib/rubocop/cop/chef/correctness/tmp_path.rb
88
- - lib/rubocop/cop/chef/deprecation/ use_automatic_resource_name.rb
89
88
  - lib/rubocop/cop/chef/deprecation/cb_depends_on_self.rb
90
89
  - lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb
91
90
  - lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb
@@ -145,6 +144,7 @@ files:
145
144
  - lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb
146
145
  - lib/rubocop/cop/chef/deprecation/run_command_helper.rb
147
146
  - lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb
147
+ - lib/rubocop/cop/chef/deprecation/use_automatic_resource_name.rb
148
148
  - lib/rubocop/cop/chef/deprecation/use_inline_resources.rb
149
149
  - lib/rubocop/cop/chef/deprecation/use_yaml_dump.rb
150
150
  - lib/rubocop/cop/chef/deprecation/user_supports_property.rb
@@ -275,8 +275,8 @@ files:
275
275
  - lib/rubocop/cop/chef/style/use_platform_helpers.rb
276
276
  - lib/rubocop/cop/target_chef_version.rb
277
277
  - lib/rubocop/monkey_patches/base.rb
278
- - lib/rubocop/monkey_patches/comment_config.rb
279
278
  - lib/rubocop/monkey_patches/config.rb
279
+ - lib/rubocop/monkey_patches/directive_comment.rb
280
280
  - lib/rubocop/monkey_patches/registry_cop.rb
281
281
  - lib/rubocop/monkey_patches/team.rb
282
282
  homepage: https://docs.chef.io/workstation/cookstyle/
@@ -296,7 +296,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
296
296
  requirements:
297
297
  - - ">="
298
298
  - !ruby/object:Gem::Version
299
- version: '2.4'
299
+ version: '2.5'
300
300
  required_rubygems_version: !ruby/object:Gem::Requirement
301
301
  requirements:
302
302
  - - ">="