Skip to content

Commit 20aca9d

Browse files
committed
Fix all offenses
1 parent 6ef288a commit 20aca9d

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,3 +269,7 @@ Naming/VariableNumber:
269269

270270
Naming/BinaryOperatorParameterName:
271271
Enabled: false
272+
273+
Style/SymbolProc:
274+
Exclude:
275+
- "spec/**/*.rb"

lib/dry/types/core.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ module Types
3535
}.freeze
3636

3737
# All built-in primitives
38-
ALL_PRIMITIVES = [KERNEL_COERCIBLE, METHOD_COERCIBLE, NON_COERCIBLE].reduce(&:merge).freeze
38+
ALL_PRIMITIVES = [
39+
KERNEL_COERCIBLE, METHOD_COERCIBLE, NON_COERCIBLE
40+
].reduce(&:merge).freeze
3941

4042
# All coercible types
4143
COERCIBLE = KERNEL_COERCIBLE.merge(METHOD_COERCIBLE).freeze
4244

4345
# All built-in primitives except {NilClass}
44-
NON_NIL = ALL_PRIMITIVES.reject { |name, _| name == :nil }.freeze
46+
NON_NIL = ALL_PRIMITIVES.except(:nil).freeze
4547

4648
# Register generic types for {ALL_PRIMITIVES}
4749
ALL_PRIMITIVES.each do |name, primitive|

lib/dry/types/hash.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def resolve_type(type)
115115
case type
116116
when Type then type
117117
when ::Class, ::String then Types[type]
118-
else type
118+
else type # rubocop:disable Lint/DuplicateBranch
119119
end
120120
end
121121

lib/dry/types/predicate_inferrer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def visit_sum(node)
137137
left = visit(left_node)
138138
right = visit(right_node)
139139

140-
if left.eql?(NIL)
140+
if left.eql?(NIL) # rubocop:disable Lint/DeprecatedConstants
141141
right
142142
else
143143
[[left, right]]

spec/dry/types/constructor_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
end
1919

2020
it "passes builder types as its type" do
21-
type = Dry::Types::Constructor.new(Dry::Types["strict.string"], fn: -> v { v.strip })
21+
type = Dry::Types::Constructor.new(
22+
Dry::Types["strict.string"], fn: -> v { v.strip }
23+
)
2224

2325
expect(type.type).to be(Dry::Types["strict.string"])
2426
end

0 commit comments

Comments
 (0)