Skip to content

Commit cec6588

Browse files
committed
style: resolve rubocop offenses
1 parent 19039a9 commit cec6588

File tree

18 files changed

+138
-20
lines changed

18 files changed

+138
-20
lines changed

.rubocop.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
inherit_from: .rubocop_todo.yml
2+
13
AllCops:
24
NewCops: enable
35
Style/HashSyntax:
46
EnforcedShorthandSyntax: never
57
Naming/BlockForwarding:
68
EnforcedStyle: explicit
9+
10+
Metrics/BlockLength:
11+
Exclude:
12+
- 'spec/**/*'
13+
14+
Lint/ConstantDefinitionInBlock:
15+
Exclude:
16+
- 'spec/**/*'

.rubocop_todo.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2026-01-01 09:52:42 UTC using RuboCop version 1.82.1.
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: 3
10+
# Configuration parameters: EnforcedStyle, AllowedGems.
11+
# SupportedStyles: Gemfile, gems.rb, gemspec
12+
Gemspec/DevelopmentDependencies:
13+
Exclude:
14+
- 'callable_tree.gemspec'
15+
16+
# Offense count: 1
17+
# Configuration parameters: AllowedParentClasses.
18+
Lint/MissingSuper:
19+
Exclude:
20+
- 'lib/callable_tree/node/root.rb'
21+
22+
# Offense count: 10
23+
# Configuration parameters: AllowKeywordBlockArguments.
24+
Lint/UnderscorePrefixedVariableName:
25+
Exclude:
26+
- 'examples/builder/identity.rb'
27+
- 'examples/builder/logging.rb'
28+
- 'examples/class/logging.rb'
29+
30+
# Offense count: 8
31+
# This cop supports safe autocorrection (--autocorrect).
32+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
33+
# NotImplementedExceptions: NotImplementedError
34+
Lint/UnusedMethodArgument:
35+
Exclude:
36+
- 'lib/callable_tree/node/builder.rb'
37+
- 'lib/callable_tree/node/external/builder.rb'
38+
- 'spec/callable_tree/node/builder_spec.rb'
39+
40+
# Offense count: 7
41+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
42+
Metrics/AbcSize:
43+
Max: 25
44+
45+
# Offense count: 14
46+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
47+
Metrics/MethodLength:
48+
Max: 45
49+
50+
# Offense count: 8
51+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
52+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
53+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
54+
Naming/FileName:
55+
Exclude:
56+
- 'Rakefile.rb'
57+
- 'examples/builder/external-verbosify.rb'
58+
- 'examples/builder/internal-broadcastable.rb'
59+
- 'examples/builder/internal-composable.rb'
60+
- 'examples/builder/internal-seekable.rb'
61+
- 'examples/class/external-verbosify.rb'
62+
- 'examples/class/internal-broadcastable.rb'
63+
- 'examples/class/internal-composable.rb'
64+
- 'examples/class/internal-seekable.rb'
65+
66+
# Offense count: 1
67+
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
68+
# AllowedMethods: call
69+
# WaywardPredicates: nonzero?
70+
Naming/PredicateMethod:
71+
Exclude:
72+
- 'spec/callable_tree/node/builder_spec.rb'
73+
74+
# Offense count: 1
75+
Style/ClassVars:
76+
Exclude:
77+
- 'lib/callable_tree/node/internal/strategyable.rb'
78+
79+
# Offense count: 40
80+
# Configuration parameters: AllowedConstants.
81+
Style/Documentation:
82+
Enabled: false
83+
84+
# Offense count: 45
85+
Style/MultilineBlockChain:
86+
Exclude:
87+
- 'examples/builder/external-verbosify.rb'
88+
- 'examples/builder/hooks.rb'
89+
- 'examples/builder/identity.rb'
90+
- 'examples/builder/internal-seekable.rb'
91+
- 'examples/builder/logging.rb'
92+
- 'examples/class/hooks.rb'
93+
- 'examples/class/logging.rb'
94+
- 'lib/callable_tree/node/internal/strategy/seek.rb'
95+
96+
# Offense count: 1
97+
# Configuration parameters: AllowedMethods.
98+
# AllowedMethods: respond_to_missing?
99+
Style/OptionalBooleanParameter:
100+
Exclude:
101+
- 'lib/callable_tree/node/builder.rb'
102+
103+
# Offense count: 5
104+
# This cop supports safe autocorrection (--autocorrect).
105+
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
106+
# URISchemes: http, https
107+
Layout/LineLength:
108+
Max: 210

Gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ source 'https://rubygems.org'
44

55
# Specify your gem's dependencies in callable_tree.gemspec
66
gemspec
7-
8-

examples/builder/external-verbosify.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
end
1313
.caller do |input, **options, &block|
1414
File.open(input) do |file|
15-
json = JSON.load(file)
15+
json = JSON.parse(file)
1616
# The following block call is equivalent to calling `super` in the class style.
1717
block.call(json, **options)
1818
end

examples/builder/identity.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
end
1313
.caller do |input, **options, &block|
1414
File.open(input) do |file|
15-
json = JSON.load(file)
15+
json = JSON.parse(file)
1616
# The following block call is equivalent to calling `super` in the class style.
1717
block.call(json, **options)
1818
end

examples/builder/internal-seekable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
end
1313
.caller do |input, **options, &original|
1414
File.open(input) do |file|
15-
json = JSON.load(file)
15+
json = JSON.parse(file)
1616
# The following block call is equivalent to calling `super` in the class style.
1717
original.call(json, **options)
1818
end

examples/builder/logging.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
end
1313
.caller do |input, **options, &original|
1414
File.open(input) do |file|
15-
json = JSON.load(file)
15+
json = JSON.parse(file)
1616
# The following block call is equivalent to calling `super` in the class style.
1717
original.call(json, **options)
1818
end

examples/class/external-verbosify.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def match?(input, **_options)
1515

1616
def call(input, **options)
1717
File.open(input) do |file|
18-
json = ::JSON.load(file)
18+
json = ::JSON.parse(file)
1919
super(json, **options)
2020
end
2121
end

examples/class/identity.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def match?(input, **_options)
2828

2929
def call(input, **options)
3030
File.open(input) do |file|
31-
json = ::JSON.load(file)
31+
json = ::JSON.parse(file)
3232
super(json, **options)
3333
end
3434
end

examples/class/internal-seekable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def match?(input, **_options)
1515

1616
def call(input, **options)
1717
File.open(input) do |file|
18-
json = ::JSON.load(file)
18+
json = ::JSON.parse(file)
1919
super(json, **options)
2020
end
2121
end

0 commit comments

Comments
 (0)