chefstyle 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 803d5b4d210e33252e9cf445357a577321cfb570fdd265e2d2c1201adb959fef
4
- data.tar.gz: 310644c9afee2356062482b09755b514b103953946060eef2c1efda388984de1
3
+ metadata.gz: bae50b8292f553fc2002075e7d7526ef65d050024c433a93b0d73861fe45068b
4
+ data.tar.gz: c5785b42ff6c818e02208a27dd2d344ee0a926fb4309d5e7ceafadf1071c53c9
5
5
  SHA512:
6
- metadata.gz: ca3e77ab4f46a9f13a2305961b665196539b684d719ceeb5765b5f6ee759ecea10548d36b6aaf4ca5741b35bf8015173bc7bffe3874b3acc93a6347bc6843400
7
- data.tar.gz: 129546eeaadf9f7cb700dfd1b3396fc8b07b14a7843be0cdb4502198540e36e9cfff0ef03c3d5fe23369d26723e71f1bc5e5a6b5975852e52933b275f8c5a7ef
6
+ metadata.gz: 6ff673315f4c611beb202d71b19b87d693c7b1e99f2385cef31b18dc86508bbca6ff3d7a4c6d9109fef41402db24033fe60ec6f358eb89c3d78f7bbba5237b3b
7
+ data.tar.gz: 673f0c42ca0850b566079fdf7a8194a9d82b519176f5893cbd087f4519d6dbf8cdd0397dc6911ceeb9a6ce16006727f5e3ee956af6f034516ab82353ae6145a0
data/config/chefstyle.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.5
3
+ NewCops: disable
4
+ DisabledByDefault: true
3
5
  SuggestExtensions: false
4
6
 
5
7
  #
@@ -43,8 +45,8 @@ Lint/DuplicateCaseCondition:
43
45
  Enabled: true
44
46
  Lint/DuplicateMethods:
45
47
  Enabled: true
46
- Lint/DuplicatedKey:
47
- Enabled: true
48
+ # Lint/DuplicatedKey: TODO broken with rubocop 1.25.1 move
49
+ # Enabled: true
48
50
  Lint/EachWithObjectArgument:
49
51
  Enabled: true
50
52
  Lint/ElseLayout:
@@ -60,8 +62,8 @@ Lint/EmptyWhen:
60
62
  Layout/EndAlignment:
61
63
  Enabled: true
62
64
  AutoCorrect: true
63
- Lint/EndInMethod:
64
- Enabled: true
65
+ # Lint/EndInMethod: TODO broken with rubocop 1.25.1 move
66
+ # Enabled: true
65
67
  Lint/EnsureReturn:
66
68
  Enabled: true
67
69
  Lint/FloatOutOfRange:
@@ -80,8 +82,8 @@ Lint/LiteralInInterpolation:
80
82
  Enabled: true
81
83
  Lint/Loop:
82
84
  Enabled: true
83
- Lint/MultipleCompare:
84
- Enabled: true
85
+ # Lint/MultipleCompare: TODO broken with rubocop 1.25.1 move
86
+ # Enabled: true
85
87
  Lint/NestedMethodDefinition:
86
88
  Enabled: true
87
89
  Lint/NextWithoutAccumulator:
@@ -104,14 +106,14 @@ Lint/ShadowedException:
104
106
  Enabled: true
105
107
  Lint/ShadowingOuterLocalVariable:
106
108
  Enabled: true
107
- Lint/StringConversionInInterpolation:
108
- Enabled: true
109
+ # Lint/StringConversionInInterpolation: TODO broken with rubocop 1.25.1 move
110
+ # Enabled: true
109
111
  Lint/UnderscorePrefixedVariableName:
110
112
  Enabled: true
111
113
  Lint/UnifiedInteger:
112
114
  Enabled: true
113
- Lint/UnneededSplatExpansion:
114
- Enabled: true
115
+ # Lint/UnneededSplatExpansion: TODO broken with rubocop 1.25.1 move
116
+ # Enabled: true
115
117
  Lint/UnreachableCode:
116
118
  Enabled: true
117
119
  Lint/UriEscapeUnescape:
@@ -120,8 +122,8 @@ Lint/UselessAccessModifier:
120
122
  Enabled: true
121
123
  Lint/UselessAssignment:
122
124
  Enabled: true
123
- Lint/UselessComparison:
124
- Enabled: true
125
+ # Lint/UselessComparison: TODO broken with rubocop 1.25.1 move
126
+ # Enabled: true
125
127
  Lint/UselessElseWithoutRescue:
126
128
  Enabled: true
127
129
  Lint/UselessSetterCall:
@@ -142,14 +144,14 @@ Lint/UnusedMethodArgument:
142
144
  Enabled: false
143
145
 
144
146
  # We ignore Exceptions a lot
145
- Lint/HandleExceptions:
147
+ Lint/SuppressedException:
146
148
  Enabled: false
147
149
  # We also decorate Exceptions a lot
148
150
  Lint/RescueException:
149
151
  Enabled: false
150
152
 
151
153
  # disabling this will make it easier to stage chefstyle rollouts
152
- Lint/UnneededCopDisableDirective:
154
+ Lint/RedundantCopDisableDirective:
153
155
  Enabled: false
154
156
 
155
157
  #
@@ -193,17 +195,17 @@ Metrics/PerceivedComplexity:
193
195
 
194
196
  Layout/AccessModifierIndentation:
195
197
  Enabled: true
196
- Layout/AlignArguments:
197
- Enabled: true
198
- EnforcedStyle: with_fixed_indentation
199
- Layout/AlignParameters:
200
- Enabled: true
201
- EnforcedStyle: with_fixed_indentation
198
+ # Layout/AlignArguments: TODO broken with rubocop 1.25.1 move
199
+ # Enabled: true
200
+ # EnforcedStyle: with_fixed_indentation
201
+ # Layout/AlignParameters: TODO broken with rubocop 1.25.1 move
202
+ # Enabled: true
203
+ # EnforcedStyle: with_fixed_indentation
202
204
  # the "ignore_implict" is here for keyword args in method calls which are
203
205
  # "implicit" hashes, and those should not be treated like normal hashes
204
- Layout/AlignHash:
205
- Enabled: true
206
- EnforcedLastArgumentHashStyle: ignore_implicit
206
+ # Layout/AlignHash: TODO broken with rubocop 1.25.1 move
207
+ # Enabled: true
208
+ # EnforcedLastArgumentHashStyle: ignore_implicit
207
209
  Style/AndOr:
208
210
  Enabled: true
209
211
  Style/ArrayJoin:
@@ -280,13 +282,13 @@ Style/IfUnlessModifierOfIfUnless:
280
282
  Enabled: true
281
283
  Style/IfWithSemicolon:
282
284
  Enabled: true
283
- Layout/IndentAssignment:
284
- Enabled: true
285
- Layout/IndentFirstArgument:
286
- EnforcedStyle: consistent
287
- Enabled: true
288
- Layout/IndentHeredoc:
289
- Enabled: true
285
+ # Layout/IndentAssignment: TODO broken with rubocop 1.25.1 move
286
+ # Enabled: true
287
+ # Layout/IndentFirstArgument: TODO broken with rubocop 1.25.1 move
288
+ # EnforcedStyle: consistent
289
+ # Enabled: true
290
+ # Layout/IndentHeredoc: TODO broken with rubocop 1.25.1 move
291
+ # Enabled: true
290
292
  Layout/IndentationConsistency:
291
293
  Enabled: true
292
294
  Layout/IndentationWidth:
@@ -454,8 +456,8 @@ Style/SymbolProc:
454
456
  Enabled: true
455
457
  Layout/IndentationStyle:
456
458
  Enabled: true
457
- Layout/TrailingBlankLines:
458
- Enabled: true
459
+ # Layout/TrailingBlankLines: TODO broken with rubocop 1.25.1 move
460
+ # Enabled: true
459
461
  Style/TrailingCommaInArguments:
460
462
  Enabled: true
461
463
  # rubocop's default gets this completely backwards
@@ -469,9 +471,9 @@ Style/TrailingUnderscoreVariable:
469
471
  Enabled: true
470
472
  Layout/TrailingWhitespace:
471
473
  Enabled: true
472
- Style/UnneededCapitalW:
473
- Enabled: true
474
- Style/UnneededInterpolation:
474
+ # Style/UnneededCapitalW: TODO broken with rubocop 1.25.1 move
475
+ # Enabled: true
476
+ Style/RedundantInterpolation:
475
477
  Enabled: false # buggy: https://github.com/rubocop-hq/rubocop/issues/6099
476
478
  #Style/UnneededPercentQ: # would like to enable this one but its buggy as of 0.35.1
477
479
  # Enabled: true
@@ -540,7 +542,7 @@ Style/IfUnlessModifier:
540
542
  Enabled: false
541
543
 
542
544
  # Dan is -1 on this one: https://github.com/chef/chef/pull/4526#issuecomment-179950045
543
- Layout/IndentFirstHashElement:
545
+ Layout/FirstHashElementIndentation:
544
546
  Enabled: false
545
547
 
546
548
  # This is overly aggressive and autofix broke stuff, would need to exclude classes
@@ -610,17 +612,13 @@ Naming/HeredocDelimiterNaming:
610
612
  Enabled: false
611
613
  Naming/PredicateName:
612
614
  Enabled: false
613
- Naming/UncommunicativeMethodParamName:
615
+ Naming/MethodParameterName:
614
616
  Enabled: false
615
617
  Naming/MemoizedInstanceVariableName:
616
618
  Enabled: false
617
619
  Naming/VariableNumber:
618
620
  Enabled: false
619
621
 
620
- # This breaks all kinds of specs in chef (i don't think it will ever quite work correctly)
621
- Style/BracesAroundHashParameters:
622
- Enabled: false
623
-
624
622
  # We almost never use format strings but this cop triggers on any string with "%{whatever}" in it and is 99% false positives
625
623
  Style/FormatStringToken:
626
624
  Enabled: false
data/config/default.yml CHANGED
@@ -1,4 +1,2 @@
1
1
  inherit_from:
2
- - upstream.yml
3
- - disable_all.yml
4
2
  - chefstyle.yml
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Chefstyle
3
- VERSION = "2.2.2"
3
+ VERSION = "2.2.3"
4
4
  RUBOCOP_VERSION = "1.25.1"
5
5
  end
data/lib/chefstyle.rb CHANGED
@@ -5,26 +5,12 @@ require_relative "chefstyle/version"
5
5
  gem "rubocop", "= #{Chefstyle::RUBOCOP_VERSION}"
6
6
  require "rubocop"
7
7
 
8
- module RuboCop
9
- class ConfigLoader
10
- RUBOCOP_HOME.gsub!(
11
- /^.*$/,
12
- File.realpath(File.join(__dir__, ".."))
13
- )
14
-
15
- DEFAULT_FILE.gsub!(
16
- /^.*$/,
17
- File.join(RUBOCOP_HOME, "config", "default.yml")
18
- )
19
- end
20
- end
21
-
22
8
  # Chefstyle patches the RuboCop tool to set a new default configuration that
23
9
  # is vendored in the Chefstyle codebase.
24
10
  module Chefstyle
25
11
  # @return [String] the absolute path to the main RuboCop configuration YAML file
26
12
  def self.config
27
- RuboCop::ConfigLoader::DEFAULT_FILE
13
+ File.realpath(File.join(__dir__, "..", "config", "default.yml"))
28
14
  end
29
15
  end
30
16
 
@@ -36,3 +22,5 @@ Dir.glob(__dir__ + "/rubocop/cop/chef/**/*.rb") do |file|
36
22
 
37
23
  require_relative file # not actually relative but require_relative is faster
38
24
  end
25
+
26
+ RuboCop::ConfigLoader.default_configuration = RuboCop::ConfigLoader.configuration_from_file(Chefstyle.config)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chefstyle
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-17 00:00:00.000000000 Z
11
+ date: 2023-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -37,8 +37,6 @@ files:
37
37
  - chefstyle.gemspec
38
38
  - config/chefstyle.yml
39
39
  - config/default.yml
40
- - config/disable_all.yml
41
- - config/upstream.yml
42
40
  - lib/chefstyle.rb
43
41
  - lib/chefstyle/version.rb
44
42
  - lib/rubocop/chef.rb