Skip to content

Commit 978c514

Browse files
committed
switch to voxpupuli-rubocop
1 parent c407756 commit 978c514

File tree

5 files changed

+201
-43
lines changed

5 files changed

+201
-43
lines changed

.rubocop.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1+
---
12
inherit_from: .rubocop_todo.yml
23

3-
require:
4-
- rubocop-performance
5-
- rubocop-rspec
6-
7-
AllCops:
8-
Exclude:
9-
- Gemfile
10-
- Rakefile
11-
- spec/fixtures/**/*
12-
- vendor/bundle/**/*
13-
NewCops: enable
14-
SuggestExtensions: false
15-
TargetRubyVersion: '2.7'
4+
inherit_gem:
5+
voxpupuli-rubocop: rubocop.yml
166

177
# Disabled
188
Style/ClassAndModuleChildren:

.rubocop_todo.yml

Lines changed: 190 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,93 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2023-04-18 09:21:48 UTC using RuboCop version 1.50.2.
3+
# on 2024-06-28 10:43:00 UTC using RuboCop version 1.63.5.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 1
10-
# This cop supports safe autocorrection (--autocorrect).
9+
# Offense count: 4
1110
# Configuration parameters: Severity, Include.
12-
# Include: **/*.gemspec
13-
Gemspec/RequireMFA:
11+
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
12+
Bundler/DuplicatedGem:
1413
Exclude:
15-
- 'puppet-modulebuilder.gemspec'
14+
- 'spec/fixtures/module/Gemfile'
1615

17-
# Offense count: 1
18-
# Configuration parameters: Severity, Include.
19-
# Include: **/*.gemspec
20-
Gemspec/RequiredRubyVersion:
16+
# Offense count: 5
17+
# This cop supports safe autocorrection (--autocorrect).
18+
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
19+
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
20+
Bundler/OrderedGems:
2121
Exclude:
22-
- 'puppet-modulebuilder.gemspec'
22+
- 'spec/fixtures/module/Gemfile'
2323

2424
# Offense count: 5
25-
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
26-
Metrics/AbcSize:
27-
Max: 31
25+
# This cop supports safe autocorrection (--autocorrect).
26+
Layout/EmptyLineAfterGuardClause:
27+
Exclude:
28+
- 'spec/fixtures/module/Rakefile'
29+
30+
# Offense count: 3
31+
# This cop supports safe autocorrection (--autocorrect).
32+
Layout/EmptyLines:
33+
Exclude:
34+
- 'Gemfile'
35+
- 'Rakefile'
36+
- 'spec/fixtures/module/Rakefile'
37+
38+
# Offense count: 1
39+
# This cop supports safe autocorrection (--autocorrect).
40+
Layout/HeredocIndentation:
41+
Exclude:
42+
- 'spec/fixtures/module/Rakefile'
2843

2944
# Offense count: 1
30-
# Configuration parameters: CountComments, CountAsOne.
31-
Metrics/ClassLength:
45+
# This cop supports safe autocorrection (--autocorrect).
46+
# Configuration parameters: Width, AllowedPatterns.
47+
Layout/IndentationWidth:
48+
Exclude:
49+
- 'Rakefile'
50+
51+
# Offense count: 2
52+
# This cop supports safe autocorrection (--autocorrect).
53+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
54+
# URISchemes: http, https
55+
Layout/LineLength:
3256
Max: 255
3357

34-
# Offense count: 6
35-
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
36-
Metrics/MethodLength:
37-
Max: 25
58+
# Offense count: 1
59+
# This cop supports safe autocorrection (--autocorrect).
60+
# Configuration parameters: EnforcedStyle.
61+
# SupportedStyles: final_newline, final_blank_line
62+
Layout/TrailingEmptyLines:
63+
Exclude:
64+
- 'spec/fixtures/module/Rakefile'
65+
66+
# Offense count: 2
67+
Lint/MixedRegexpCaptureTypes:
68+
Exclude:
69+
- 'Gemfile'
70+
- 'spec/fixtures/module/Gemfile'
3871

3972
# Offense count: 1
40-
# Configuration parameters: MinSize.
41-
Performance/CollectionLiteralInLoop:
73+
# Configuration parameters: ForbiddenDelimiters.
74+
# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$))
75+
Naming/HeredocDelimiterNaming:
4276
Exclude:
43-
- 'spec/acceptance/puppet/modulebuilder/builder_spec.rb'
77+
- 'spec/fixtures/module/Rakefile'
78+
79+
# Offense count: 13
80+
# Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns.
81+
# SupportedStyles: snake_case, camelCase
82+
Naming/VariableName:
83+
Exclude:
84+
- 'spec/fixtures/module/Rakefile'
85+
86+
# Offense count: 1
87+
# This cop supports safe autocorrection (--autocorrect).
88+
Performance/StringIdentifierArgument:
89+
Exclude:
90+
- 'spec/fixtures/module/Rakefile'
4491

4592
# Offense count: 4
4693
# Configuration parameters: Prefixes, AllowedPatterns.
@@ -82,14 +129,131 @@ RSpec/NamedSubject:
82129
RSpec/NestedGroups:
83130
Max: 5
84131

85-
# Offense count: 33
132+
# Offense count: 32
86133
RSpec/SubjectStub:
87134
Exclude:
88135
- 'spec/unit/puppet/modulebuilder/builder_spec.rb'
89136

90-
# Offense count: 9
137+
# Offense count: 1
138+
Security/Eval:
139+
Exclude:
140+
- 'spec/fixtures/module/Gemfile'
141+
142+
# Offense count: 3
143+
# This cop supports unsafe autocorrection (--autocorrect-all).
144+
Security/JSONLoad:
145+
Exclude:
146+
- 'spec/fixtures/module/Rakefile'
147+
148+
# Offense count: 1
149+
# This cop supports unsafe autocorrection (--autocorrect-all).
150+
# Configuration parameters: EnforcedStyle.
151+
# SupportedStyles: always, conditionals
152+
Style/AndOr:
153+
Exclude:
154+
- 'spec/fixtures/module/Rakefile'
155+
156+
# Offense count: 4
157+
# This cop supports safe autocorrection (--autocorrect).
158+
# Configuration parameters: AllowedVars.
159+
Style/FetchEnvVar:
160+
Exclude:
161+
- 'Gemfile'
162+
- 'spec/fixtures/module/Gemfile'
163+
164+
# Offense count: 1
165+
# This cop supports unsafe autocorrection (--autocorrect-all).
166+
# Configuration parameters: EnforcedStyle.
167+
# SupportedStyles: always, always_true, never
168+
Style/FrozenStringLiteralComment:
169+
Exclude:
170+
- 'spec/fixtures/module/Gemfile'
171+
172+
# Offense count: 1
173+
# This cop supports safe autocorrection (--autocorrect).
174+
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
175+
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
176+
# SupportedShorthandSyntax: always, never, either, consistent
177+
Style/HashSyntax:
178+
Exclude:
179+
- 'Gemfile'
180+
181+
# Offense count: 2
182+
# This cop supports safe autocorrection (--autocorrect).
183+
Style/IfUnlessModifier:
184+
Exclude:
185+
- 'spec/fixtures/module/Gemfile'
186+
- 'spec/fixtures/module/Rakefile'
187+
188+
# Offense count: 3
189+
# This cop supports unsafe autocorrection (--autocorrect-all).
190+
Style/RedundantInterpolation:
191+
Exclude:
192+
- 'spec/fixtures/module/Rakefile'
193+
194+
# Offense count: 5
195+
# This cop supports safe autocorrection (--autocorrect).
196+
Style/RedundantRegexpEscape:
197+
Exclude:
198+
- 'Gemfile'
199+
- 'spec/fixtures/module/Gemfile'
200+
- 'spec/fixtures/module/Rakefile'
201+
202+
# Offense count: 1
203+
# This cop supports safe autocorrection (--autocorrect).
204+
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
205+
# SupportedStyles: slashes, percent_r, mixed
206+
Style/RegexpLiteral:
207+
Exclude:
208+
- 'Gemfile'
209+
210+
# Offense count: 1
211+
# This cop supports unsafe autocorrection (--autocorrect-all).
212+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
213+
# AllowedMethods: present?, blank?, presence, try, try!
214+
Style/SafeNavigation:
215+
Exclude:
216+
- 'spec/fixtures/module/Rakefile'
217+
218+
# Offense count: 49
219+
# This cop supports safe autocorrection (--autocorrect).
220+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
221+
# SupportedStyles: single_quotes, double_quotes
222+
Style/StringLiterals:
223+
Exclude:
224+
- 'spec/fixtures/module/Gemfile'
225+
- 'spec/fixtures/module/Rakefile'
226+
227+
# Offense count: 1
228+
# This cop supports safe autocorrection (--autocorrect).
229+
# Configuration parameters: MinSize.
230+
# SupportedStyles: percent, brackets
231+
Style/SymbolArray:
232+
EnforcedStyle: brackets
233+
234+
# Offense count: 7
235+
# This cop supports safe autocorrection (--autocorrect).
236+
# Configuration parameters: EnforcedStyleForMultiline.
237+
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
238+
Style/TrailingCommaInArrayLiteral:
239+
Exclude:
240+
- 'lib/puppet/modulebuilder/builder.rb'
241+
- 'spec/spec_helper.rb'
242+
- 'spec/unit/puppet/modulebuilder/builder_spec.rb'
243+
244+
# Offense count: 7
245+
# This cop supports safe autocorrection (--autocorrect).
246+
# Configuration parameters: EnforcedStyleForMultiline.
247+
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
248+
Style/TrailingCommaInHashLiteral:
249+
Exclude:
250+
- 'lib/puppet/modulebuilder/builder.rb'
251+
- 'spec/fixtures/module/Rakefile'
252+
- 'spec/unit/puppet/modulebuilder/builder_spec.rb'
253+
254+
# Offense count: 11
91255
# This cop supports safe autocorrection (--autocorrect).
92256
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
93257
# URISchemes: http, https
94258
Layout/LineLength:
95-
Max: 188
259+
Max: 255

Gemfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ group :development do
2424
gem 'rake'
2525
gem 'rspec', '~> 3.1'
2626

27-
gem 'rubocop', '~> 1.64.0', require: false
28-
gem 'rubocop-performance', '~> 1.16', require: false
29-
gem 'rubocop-rspec', '~> 3.0', require: false
30-
3127
gem 'simplecov'
3228
gem 'simplecov-console'
3329

Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ RSpec::Core::RakeTask.new(:acceptance) do |t|
2121
end
2222

2323
task default: [:spec, :acceptance]
24+
25+
begin
26+
require 'voxpupuli/rubocop/rake'
27+
rescue LoadError
28+
# the voxpupuli-rubocop gem is optional
29+
end

puppet-modulebuilder.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@ Gem::Specification.new do |spec|
2727
spec.add_runtime_dependency 'minitar', '~> 0.9'
2828
spec.add_runtime_dependency 'pathspec', '>= 0.2.1', '< 2.0.0'
2929

30+
spec.add_development_dependency 'voxpupuli-rubocop', '~> 2.7.0'
31+
3032
spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
3133
end

0 commit comments

Comments
 (0)