Skip to content

Commit d2c4954

Browse files
committed
chore: rubocop
1 parent b67e5bd commit d2c4954

23 files changed

+493
-161
lines changed

.rubocop_todo.yml

Lines changed: 262 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,211 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2025-12-01 12:13:26 UTC using RuboCop version 1.81.7.
3+
# on 2025-12-01 12:15:10 UTC using RuboCop version 1.81.7.
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: 2
10+
# This cop supports safe autocorrection (--autocorrect).
11+
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
12+
Bundler/OrderedGems:
13+
Exclude:
14+
- 'Gemfile'
15+
916
# Offense count: 1
1017
# This cop supports safe autocorrection (--autocorrect).
11-
Layout/EmptyLineAfterMagicComment:
18+
# Configuration parameters: Severity.
19+
Gemspec/RequireMFA:
1220
Exclude:
13-
- 'lib/genericode/namespace.rb'
21+
- 'genericode.gemspec'
1422

1523
# Offense count: 1
24+
# Configuration parameters: Severity.
25+
Gemspec/RequiredRubyVersion:
26+
Exclude:
27+
- 'genericode.gemspec'
28+
29+
# Offense count: 36
1630
# This cop supports safe autocorrection (--autocorrect).
17-
Layout/EmptyLinesAfterModuleInclusion:
31+
# Configuration parameters: EnforcedStyle, IndentationWidth.
32+
# SupportedStyles: with_first_argument, with_fixed_indentation
33+
Layout/ArgumentAlignment:
1834
Exclude:
19-
- 'lib/genericode/code_list_set_ref.rb'
35+
- 'lib/genericode/cli/code_lister.rb'
36+
- 'lib/genericode/cli/commands.rb'
37+
- 'lib/genericode/cli/converter.rb'
38+
- 'lib/genericode/cli/validator.rb'
39+
- 'lib/genericode/identification.rb'
40+
- 'spec/genericode/cli/code_lookup_spec.rb'
41+
- 'spec/genericode/cli/commands_spec.rb'
42+
- 'spec/genericode/cli/converter_spec.rb'
43+
- 'spec/genericode/cli/validator_spec.rb'
44+
- 'spec/genericode/code_list_spec.rb'
2045

2146
# Offense count: 3
2247
# This cop supports safe autocorrection (--autocorrect).
23-
# Configuration parameters: EnforcedStyle.
24-
# SupportedStyles: final_newline, final_blank_line
25-
Layout/TrailingEmptyLines:
48+
# Configuration parameters: EnforcedStyle, IndentationWidth.
49+
# SupportedStyles: with_first_element, with_fixed_indentation
50+
Layout/ArrayAlignment:
2651
Exclude:
27-
- 'lib/genericode/cli/code_lister.rb'
28-
- 'lib/genericode/namespace.rb'
52+
- 'genericode.gemspec'
53+
- 'lib/genericode/cli/converter.rb'
54+
55+
# Offense count: 2
56+
# This cop supports safe autocorrection (--autocorrect).
57+
# Configuration parameters: IndentationWidth.
58+
Layout/AssignmentIndentation:
59+
Exclude:
60+
- 'lib/genericode/agency.rb'
61+
- 'lib/genericode/identification.rb'
62+
63+
# Offense count: 18
64+
# This cop supports safe autocorrection (--autocorrect).
65+
# Configuration parameters: EnforcedStyleAlignWith.
66+
# SupportedStylesAlignWith: either, start_of_block, start_of_line
67+
Layout/BlockAlignment:
68+
Exclude:
69+
- 'lib/genericode/code_list.rb'
70+
- 'lib/genericode/key.rb'
71+
- 'spec/genericode/cli/commands_spec.rb'
72+
- 'spec/genericode/cli/validator_spec.rb'
73+
- 'spec/genericode/code_list_spec.rb'
2974
- 'spec/genericode_spec.rb'
3075

76+
# Offense count: 18
77+
# This cop supports safe autocorrection (--autocorrect).
78+
Layout/BlockEndNewline:
79+
Exclude:
80+
- 'lib/genericode/code_list.rb'
81+
- 'lib/genericode/key.rb'
82+
- 'spec/genericode/cli/commands_spec.rb'
83+
- 'spec/genericode/cli/validator_spec.rb'
84+
- 'spec/genericode/code_list_spec.rb'
85+
- 'spec/genericode_spec.rb'
86+
87+
# Offense count: 4
88+
# This cop supports safe autocorrection (--autocorrect).
89+
Layout/ClosingParenthesisIndentation:
90+
Exclude:
91+
- 'spec/genericode/cli/commands_spec.rb'
92+
3193
# Offense count: 1
32-
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
33-
Lint/DuplicateBranch:
94+
# This cop supports safe autocorrection (--autocorrect).
95+
Layout/EmptyLineAfterGuardClause:
96+
Exclude:
97+
- 'lib/genericode/cli/converter.rb'
98+
99+
# Offense count: 4
100+
# This cop supports safe autocorrection (--autocorrect).
101+
# Configuration parameters: EnforcedStyle, IndentationWidth.
102+
# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
103+
Layout/FirstArgumentIndentation:
34104
Exclude:
105+
- 'spec/genericode/cli/commands_spec.rb'
106+
107+
# Offense count: 42
108+
# This cop supports safe autocorrection (--autocorrect).
109+
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
110+
# SupportedHashRocketStyles: key, separator, table
111+
# SupportedColonStyles: key, separator, table
112+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
113+
Layout/HashAlignment:
114+
Exclude:
115+
- 'genericode.gemspec'
116+
- 'lib/genericode/agency.rb'
117+
- 'lib/genericode/cli/commands.rb'
35118
- 'lib/genericode/code_list.rb'
119+
- 'lib/genericode/code_list_ref.rb'
120+
- 'lib/genericode/code_list_set.rb'
121+
- 'lib/genericode/code_list_set_ref.rb'
122+
- 'lib/genericode/column.rb'
123+
- 'lib/genericode/datatype_facet.rb'
124+
- 'lib/genericode/identification.rb'
125+
- 'lib/genericode/key.rb'
126+
- 'spec/genericode/code_list_spec.rb'
36127

37128
# Offense count: 1
38129
# This cop supports safe autocorrection (--autocorrect).
39-
# Configuration parameters: CheckForMethodsWithNoSideEffects.
40-
Lint/Void:
130+
# Configuration parameters: EnforcedStyle.
131+
# SupportedStyles: normal, indented_internal_methods
132+
Layout/IndentationConsistency:
133+
Exclude:
134+
- 'genericode.gemspec'
135+
136+
# Offense count: 36
137+
# This cop supports safe autocorrection (--autocorrect).
138+
# Configuration parameters: Width, AllowedPatterns.
139+
Layout/IndentationWidth:
41140
Exclude:
42141
- 'lib/genericode/code_list.rb'
142+
- 'lib/genericode/key.rb'
143+
- 'spec/genericode/cli/commands_spec.rb'
144+
- 'spec/genericode/cli/validator_spec.rb'
145+
- 'spec/genericode/code_list_spec.rb'
146+
- 'spec/genericode_spec.rb'
43147

44-
# Offense count: 8
45-
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
46-
Metrics/AbcSize:
47-
Max: 182
148+
# Offense count: 153
149+
# This cop supports safe autocorrection (--autocorrect).
150+
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
151+
# URISchemes: http, https
152+
Layout/LineLength:
153+
Enabled: false
48154

49-
# Offense count: 2
50-
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
51-
# AllowedMethods: refine
52-
Metrics/BlockLength:
53-
Max: 34
155+
# Offense count: 4
156+
# This cop supports safe autocorrection (--autocorrect).
157+
# Configuration parameters: EnforcedStyle.
158+
# SupportedStyles: symmetrical, new_line, same_line
159+
Layout/MultilineMethodCallBraceLayout:
160+
Exclude:
161+
- 'spec/genericode/cli/commands_spec.rb'
162+
163+
# Offense count: 60
164+
# This cop supports safe autocorrection (--autocorrect).
165+
# Configuration parameters: AllowInHeredoc.
166+
Layout/TrailingWhitespace:
167+
Enabled: false
54168

55169
# Offense count: 1
56-
# Configuration parameters: CountComments, CountAsOne.
57-
Metrics/ClassLength:
58-
Max: 216
170+
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
171+
Lint/DuplicateBranch:
172+
Exclude:
173+
- 'lib/genericode/code_list.rb'
59174

60-
# Offense count: 6
61-
# Configuration parameters: AllowedMethods, AllowedPatterns.
175+
# Offense count: 11
176+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
177+
Metrics/AbcSize:
178+
Exclude:
179+
- 'lib/genericode/cli/code_lister.rb'
180+
- 'lib/genericode/cli/commands.rb'
181+
- 'lib/genericode/cli/validator.rb'
182+
- 'lib/genericode/code_list.rb'
183+
- 'lib/genericode/code_list_set.rb'
184+
- 'spec/genericode_spec.rb'
185+
186+
# Offense count: 7
187+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
62188
Metrics/CyclomaticComplexity:
63-
Max: 92
189+
Exclude:
190+
- 'lib/genericode/cli/code_lister.rb'
191+
- 'lib/genericode/cli/validator.rb'
192+
- 'lib/genericode/code_list.rb'
193+
- 'lib/genericode/code_list_set.rb'
64194

65-
# Offense count: 9
195+
# Offense count: 10
66196
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
67197
Metrics/MethodLength:
68-
Max: 86
198+
Max: 112
69199

70-
# Offense count: 3
71-
# Configuration parameters: AllowedMethods, AllowedPatterns.
200+
# Offense count: 8
201+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
72202
Metrics/PerceivedComplexity:
73-
Max: 92
203+
Exclude:
204+
- 'lib/genericode/cli/code_lister.rb'
205+
- 'lib/genericode/cli/commands.rb'
206+
- 'lib/genericode/cli/validator.rb'
207+
- 'lib/genericode/code_list.rb'
208+
- 'lib/genericode/code_list_set.rb'
74209

75210
# Offense count: 2
76211
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
@@ -81,24 +216,106 @@ Naming/PredicateMethod:
81216
- 'lib/genericode/cli/converter.rb'
82217
- 'lib/genericode/cli/validator.rb'
83218

84-
# Offense count: 1
219+
# Offense count: 2
220+
RSpec/AnyInstance:
221+
Exclude:
222+
- 'spec/genericode/cli/converter_spec.rb'
223+
224+
# Offense count: 17
85225
# This cop supports unsafe autocorrection (--autocorrect-all).
86-
# Configuration parameters: EnforcedStyle.
87-
# SupportedStyles: always, always_true, never
88-
Style/FrozenStringLiteralComment:
226+
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
227+
# SupportedStyles: described_class, explicit
228+
RSpec/DescribedClass:
89229
Exclude:
90-
- '**/*.arb'
91-
- 'lib/genericode/namespace.rb'
230+
- 'spec/genericode/cli/code_lister_spec.rb'
231+
- 'spec/genericode/cli/code_lookup_spec.rb'
232+
- 'spec/genericode/cli/converter_spec.rb'
233+
- 'spec/genericode/cli/validator_spec.rb'
234+
235+
# Offense count: 17
236+
# Configuration parameters: CountAsOne.
237+
RSpec/ExampleLength:
238+
Max: 23
239+
240+
# Offense count: 2
241+
RSpec/LeakyLocalVariable:
242+
Exclude:
243+
- 'spec/genericode/code_list_spec.rb'
92244

93245
# Offense count: 1
246+
RSpec/MultipleExpectations:
247+
Max: 3
248+
249+
# Offense count: 2
250+
# Configuration parameters: AllowedPatterns.
251+
# AllowedPatterns: ^expect_, ^assert_
252+
RSpec/NoExpectationExample:
253+
Exclude:
254+
- 'spec/genericode_spec.rb'
255+
256+
# Offense count: 6
257+
# This cop supports unsafe autocorrection (--autocorrect-all).
258+
RSpec/ReceiveMessages:
259+
Exclude:
260+
- 'spec/genericode/cli/validator_spec.rb'
261+
262+
# Offense count: 30
94263
# This cop supports safe autocorrection (--autocorrect).
95-
Style/IfUnlessModifier:
264+
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
265+
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
266+
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
267+
# FunctionalMethods: let, let!, subject, watch
268+
# AllowedMethods: lambda, proc, it
269+
Style/BlockDelimiters:
96270
Exclude:
271+
- 'lib/genericode/code_list.rb'
272+
- 'lib/genericode/key.rb'
273+
- 'spec/genericode/cli/commands_spec.rb'
274+
- 'spec/genericode/cli/validator_spec.rb'
275+
- 'spec/genericode/code_list_spec.rb'
97276
- 'spec/genericode_spec.rb'
98277

278+
# Offense count: 7
279+
# This cop supports safe autocorrection (--autocorrect).
280+
Style/MultilineIfModifier:
281+
Exclude:
282+
- 'lib/genericode/cli/code_lister.rb'
283+
- 'lib/genericode/cli/converter.rb'
284+
- 'lib/genericode/cli/validator.rb'
285+
- 'lib/genericode/code_list_set.rb'
286+
99287
# Offense count: 2
100288
# This cop supports safe autocorrection (--autocorrect).
101-
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
102-
# URISchemes: http, https
103-
Layout/LineLength:
104-
Max: 121
289+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
290+
# SupportedStyles: single_quotes, double_quotes
291+
Style/StringLiterals:
292+
Exclude:
293+
- 'genericode.gemspec'
294+
295+
# Offense count: 8
296+
# This cop supports safe autocorrection (--autocorrect).
297+
# Configuration parameters: EnforcedStyleForMultiline.
298+
# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
299+
Style/TrailingCommaInArguments:
300+
Exclude:
301+
- 'spec/genericode/cli/code_lister_spec.rb'
302+
- 'spec/genericode/cli/code_lookup_spec.rb'
303+
- 'spec/genericode/cli/converter_spec.rb'
304+
- 'spec/genericode/code_list_spec.rb'
305+
306+
# Offense count: 1
307+
# This cop supports safe autocorrection (--autocorrect).
308+
# Configuration parameters: EnforcedStyleForMultiline.
309+
# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
310+
Style/TrailingCommaInArrayLiteral:
311+
Exclude:
312+
- 'lib/genericode/code_list.rb'
313+
314+
# Offense count: 11
315+
# This cop supports safe autocorrection (--autocorrect).
316+
# Configuration parameters: EnforcedStyleForMultiline.
317+
# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
318+
Style/TrailingCommaInHashLiteral:
319+
Exclude:
320+
- 'lib/genericode/code_list.rb'
321+
- 'lib/genericode/identification.rb'

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ gem "openssl"
1212
gem "rake"
1313
gem "rspec"
1414
gem "rubocop"
15+
gem "rubocop-performance"
1516
gem "rubocop-rake"
1617
gem "rubocop-rspec"
17-
gem "rubocop-performance"

genericode.gemspec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ Gem::Specification.new do |spec|
1616
spec.metadata["homepage_uri"] = spec.homepage
1717
spec.metadata["source_code_uri"] = spec.homepage
1818
spec.metadata["changelog_uri"] = "https://github.com/lutaml/genericode/releases"
19+
spec.metadata["rubygems_mfa_required"] = "true"
1920

2021
gemspec = File.basename(__FILE__)
21-
spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
22+
spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__,
23+
err: IO::NULL) do |ls|
2224
ls.readlines("\x0", chomp: true).reject do |f|
2325
(f == gemspec) ||
24-
f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
26+
f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor
27+
Gemfile])
2528
end
2629
end
2730
spec.bindir = "exe"

0 commit comments

Comments
 (0)