Skip to content

Commit f510a03

Browse files
committed
Specifies rubocop target version
Sonatype Lift is using Rubocop to report quality violations. The default configuration Sonatype Lift is using is not publically available. So in order to fix the comment that it left on the pull request after the version requirement was added to the `.gemspec` file, I added Rubocop as a development dependency, and then generated a TODO style configuration that excludes all of the default warnings except for the one that Sonatype Lift reported. That one was fixed. Signed-off-by: M. Scott Ford <[email protected]>
1 parent 40a61d9 commit f510a03

File tree

3 files changed

+308
-0
lines changed

3 files changed

+308
-0
lines changed

.rubocop.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
AllCops:
2+
NewCops: enable
3+
TargetRubyVersion: 2.7
4+
5+
inherit_from: .rubocop_todo.yml
6+
7+
# The behavior of RuboCop can be controlled via the .rubocop.yml
8+
# configuration file. It makes it possible to enable/disable
9+
# certain cops (checks) and to alter their behavior if they accept
10+
# any parameters. The file can be placed either in your home
11+
# directory or in some project directory.
12+
#
13+
# RuboCop will start looking for the configuration file in the directory
14+
# where the inspected file is and continue its way up to the root directory.
15+
#
16+
# See https://docs.rubocop.org/rubocop/configuration
17+

.rubocop_todo.yml

Lines changed: 290 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,290 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2023-04-05 19:57:43 UTC using RuboCop version 1.49.0.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 1
10+
# This cop supports safe autocorrection (--autocorrect).
11+
# Configuration parameters: Severity, Include.
12+
# Include: **/*.gemspec
13+
Gemspec/DeprecatedAttributeAssignment:
14+
Exclude:
15+
- 'cyclonedx-ruby.gemspec'
16+
17+
# Offense count: 4
18+
# This cop supports safe autocorrection (--autocorrect).
19+
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
20+
# Include: **/*.gemspec
21+
Gemspec/OrderedDependencies:
22+
Exclude:
23+
- 'cyclonedx-ruby.gemspec'
24+
25+
# Offense count: 1
26+
# This cop supports safe autocorrection (--autocorrect).
27+
# Configuration parameters: Severity, Include.
28+
# Include: **/*.gemspec
29+
Gemspec/RequireMFA:
30+
Exclude:
31+
- 'cyclonedx-ruby.gemspec'
32+
33+
# Offense count: 1
34+
# This cop supports safe autocorrection (--autocorrect).
35+
Layout/EmptyLineAfterMagicComment:
36+
Exclude:
37+
- 'lib/bom_builder.rb'
38+
39+
# Offense count: 1
40+
# This cop supports safe autocorrection (--autocorrect).
41+
# Configuration parameters: EnforcedStyle.
42+
# SupportedStyles: around, only_before
43+
Layout/EmptyLinesAroundAccessModifier:
44+
Exclude:
45+
- 'lib/bom_builder.rb'
46+
47+
# Offense count: 1
48+
# This cop supports safe autocorrection (--autocorrect).
49+
Layout/EmptyLinesAroundMethodBody:
50+
Exclude:
51+
- 'lib/bom_component.rb'
52+
53+
# Offense count: 1
54+
# This cop supports safe autocorrection (--autocorrect).
55+
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
56+
Layout/ExtraSpacing:
57+
Exclude:
58+
- 'cyclonedx-ruby.gemspec'
59+
60+
# Offense count: 1
61+
# This cop supports safe autocorrection (--autocorrect).
62+
# Configuration parameters: EnforcedStyle, IndentationWidth.
63+
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
64+
Layout/FirstArrayElementIndentation:
65+
Exclude:
66+
- 'lib/bom_component.rb'
67+
68+
# Offense count: 1
69+
# This cop supports safe autocorrection (--autocorrect).
70+
Layout/LeadingEmptyLines:
71+
Exclude:
72+
- 'lib/bom_component.rb'
73+
74+
# Offense count: 2
75+
# This cop supports safe autocorrection (--autocorrect).
76+
# Configuration parameters: EnforcedStyle.
77+
# SupportedStyles: final_newline, final_blank_line
78+
Layout/TrailingEmptyLines:
79+
Exclude:
80+
- 'Rakefile'
81+
- 'lib/bom_component.rb'
82+
83+
# Offense count: 3
84+
# This cop supports safe autocorrection (--autocorrect).
85+
# Configuration parameters: AllowInHeredoc.
86+
Layout/TrailingWhitespace:
87+
Exclude:
88+
- 'Rakefile'
89+
- 'spec/bom_component_spec.rb'
90+
91+
# Offense count: 2
92+
Lint/IneffectiveAccessModifier:
93+
Exclude:
94+
- 'lib/bom_builder.rb'
95+
96+
# Offense count: 1
97+
# This cop supports safe autocorrection (--autocorrect).
98+
Lint/ScriptPermission:
99+
Exclude:
100+
- 'Rakefile'
101+
102+
# Offense count: 1
103+
Lint/ShadowingOuterLocalVariable:
104+
Exclude:
105+
- 'lib/bom_builder.rb'
106+
107+
# Offense count: 19
108+
# This cop supports safe autocorrection (--autocorrect).
109+
# Configuration parameters: EnforcedStyle.
110+
# SupportedStyles: strict, consistent
111+
Lint/SymbolConversion:
112+
Exclude:
113+
- 'lib/bom_component.rb'
114+
- 'lib/bom_helpers.rb'
115+
116+
# Offense count: 1
117+
# This cop supports safe autocorrection (--autocorrect).
118+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
119+
Lint/UnusedMethodArgument:
120+
Exclude:
121+
- 'lib/bom_builder.rb'
122+
123+
# Offense count: 1
124+
# This cop supports safe autocorrection (--autocorrect).
125+
# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
126+
Lint/UselessAccessModifier:
127+
Exclude:
128+
- 'lib/bom_builder.rb'
129+
130+
# Offense count: 4
131+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
132+
Metrics/AbcSize:
133+
Max: 67
134+
135+
# Offense count: 4
136+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
137+
# AllowedMethods: refine
138+
Metrics/BlockLength:
139+
Max: 38
140+
141+
# Offense count: 1
142+
# Configuration parameters: CountComments, CountAsOne.
143+
Metrics/ClassLength:
144+
Max: 128
145+
146+
# Offense count: 1
147+
# Configuration parameters: AllowedMethods, AllowedPatterns.
148+
Metrics/CyclomaticComplexity:
149+
Max: 9
150+
151+
# Offense count: 6
152+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
153+
Metrics/MethodLength:
154+
Max: 68
155+
156+
# Offense count: 1
157+
# Configuration parameters: AllowedMethods, AllowedPatterns.
158+
Metrics/PerceivedComplexity:
159+
Max: 12
160+
161+
# Offense count: 1
162+
# This cop supports safe autocorrection (--autocorrect).
163+
# Configuration parameters: PreferredName.
164+
Naming/RescuedExceptionsVariableName:
165+
Exclude:
166+
- 'Rakefile'
167+
168+
# Offense count: 3
169+
# Configuration parameters: AllowedConstants.
170+
Style/Documentation:
171+
Exclude:
172+
- 'spec/**/*'
173+
- 'test/**/*'
174+
- 'Rakefile'
175+
- 'lib/bom_builder.rb'
176+
- 'lib/bom_component.rb'
177+
178+
# Offense count: 1
179+
# This cop supports safe autocorrection (--autocorrect).
180+
# Configuration parameters: AllowedVars.
181+
Style/FetchEnvVar:
182+
Exclude:
183+
- 'lib/bom_helpers.rb'
184+
185+
# Offense count: 1
186+
# This cop supports safe autocorrection (--autocorrect).
187+
Style/FileWrite:
188+
Exclude:
189+
- 'lib/bom_builder.rb'
190+
191+
# Offense count: 12
192+
# This cop supports unsafe autocorrection (--autocorrect-all).
193+
# Configuration parameters: EnforcedStyle.
194+
# SupportedStyles: always, always_true, never
195+
Style/FrozenStringLiteralComment:
196+
Exclude:
197+
- '.simplecov'
198+
- 'Gemfile'
199+
- 'Rakefile'
200+
- 'features/fixtures/simple/Gemfile'
201+
- 'features/step_definitions/json_bom_matching.rb'
202+
- 'features/step_definitions/xml_bom_matching.rb'
203+
- 'features/support/env.rb'
204+
- 'features/support/simplecov_support.rb'
205+
- 'lib/bom_component.rb'
206+
- 'spec/bom_component_spec.rb'
207+
- 'spec/bom_helpers_spec.rb'
208+
- 'spec/spec_helper.rb'
209+
210+
# Offense count: 1
211+
# This cop supports safe autocorrection (--autocorrect).
212+
# Configuration parameters: AllowedMethods, AllowedPatterns.
213+
Style/MethodCallWithoutArgsParentheses:
214+
Exclude:
215+
- 'lib/bom_helpers.rb'
216+
217+
# Offense count: 1
218+
# This cop supports unsafe autocorrection (--autocorrect-all).
219+
# Configuration parameters: EnforcedStyle.
220+
# SupportedStyles: literals, strict
221+
Style/MutableConstant:
222+
Exclude:
223+
- 'lib/bom_builder.rb'
224+
225+
# Offense count: 2
226+
Style/OpenStructUse:
227+
Exclude:
228+
- 'lib/bom_builder.rb'
229+
- 'spec/bom_component_spec.rb'
230+
231+
# Offense count: 1
232+
# This cop supports safe autocorrection (--autocorrect).
233+
# Configuration parameters: PreferredDelimiters.
234+
Style/PercentLiteralDelimiters:
235+
Exclude:
236+
- 'Rakefile'
237+
238+
# Offense count: 19
239+
# This cop supports safe autocorrection (--autocorrect).
240+
# Configuration parameters: .
241+
# SupportedStyles: same_as_string_literals, single_quotes, double_quotes
242+
Style/QuotedSymbols:
243+
EnforcedStyle: double_quotes
244+
245+
# Offense count: 1
246+
# This cop supports safe autocorrection (--autocorrect).
247+
Style/RedundantBegin:
248+
Exclude:
249+
- 'Rakefile'
250+
251+
# Offense count: 6
252+
# This cop supports safe autocorrection (--autocorrect).
253+
Style/RedundantRegexpEscape:
254+
Exclude:
255+
- 'features/step_definitions/json_bom_matching.rb'
256+
- 'features/step_definitions/xml_bom_matching.rb'
257+
258+
# Offense count: 20
259+
# This cop supports safe autocorrection (--autocorrect).
260+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
261+
# SupportedStyles: single_quotes, double_quotes
262+
Style/StringLiterals:
263+
Exclude:
264+
- '.simplecov'
265+
- 'Rakefile'
266+
- 'cyclonedx-ruby.gemspec'
267+
- 'lib/bom_component.rb'
268+
- 'lib/bom_helpers.rb'
269+
- 'spec/bom_component_spec.rb'
270+
- 'spec/bom_helpers_spec.rb'
271+
272+
# Offense count: 1
273+
# This cop supports safe autocorrection (--autocorrect).
274+
# Configuration parameters: MinSize.
275+
# SupportedStyles: percent, brackets
276+
Style/SymbolArray:
277+
EnforcedStyle: brackets
278+
279+
# Offense count: 2
280+
# This cop supports safe autocorrection (--autocorrect).
281+
Style/SymbolLiteral:
282+
Exclude:
283+
- 'lib/bom_component.rb'
284+
285+
# Offense count: 5
286+
# This cop supports safe autocorrection (--autocorrect).
287+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
288+
# URISchemes: http, https
289+
Layout/LineLength:
290+
Max: 237

cyclonedx-ruby.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ Gem::Specification.new do |spec|
3232
spec.add_development_dependency 'cucumber', '~> 8.0'
3333
spec.add_development_dependency 'aruba', '~> 2.1'
3434
spec.add_development_dependency 'simplecov', '~> 0.22.0'
35+
spec.add_development_dependency 'rubocop', '~> 1.48'
3536
end

0 commit comments

Comments
 (0)