File tree 5 files changed +10
-3
lines changed
5 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
require :
2
2
- rubocop-rake
3
3
- rubocop-rspec
4
+ - rubocop-performance
4
5
5
6
AllCops :
6
7
TargetRubyVersion : 3.1
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ gem "rake"
9
9
gem "rbs-inline" , require : false
10
10
gem "rspec"
11
11
gem "rubocop" , require : false
12
+ gem "rubocop-performance" , require : false
12
13
gem "rubocop-rake" , require : false
13
14
gem "rubocop-rspec" , require : false
14
15
gem "simplecov"
Original file line number Diff line number Diff line change 31
31
docile (1.4.1 )
32
32
drb (2.2.1 )
33
33
ffi (1.17.0 )
34
+ ffi (1.17.0-arm64-darwin )
34
35
fileutils (1.7.3 )
35
36
i18n (1.14.6 )
36
37
concurrent-ruby (~> 1.0 )
84
85
unicode-display_width (>= 2.4.0 , < 4.0 )
85
86
rubocop-ast (1.37.0 )
86
87
parser (>= 3.3.1.0 )
88
+ rubocop-performance (1.23.1 )
89
+ rubocop (>= 1.48.1 , < 2.0 )
90
+ rubocop-ast (>= 1.31.1 , < 2.0 )
87
91
rubocop-rake (0.6.0 )
88
92
rubocop (~> 1.0 )
89
93
rubocop-rspec (3.3.0 )
@@ -134,6 +138,7 @@ DEPENDENCIES
134
138
rbs-trace !
135
139
rspec
136
140
rubocop
141
+ rubocop-performance
137
142
rubocop-rake
138
143
rubocop-rspec
139
144
simplecov
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ def merge_method_types(method_types) # rubocop:disable Metrics
74
74
def merge_types ( types )
75
75
return types . first if types . one?
76
76
77
- optional = types . any? { | type | type . is_a? ( Types ::Bases ::Nil ) }
77
+ optional = types . any? ( Types ::Bases ::Nil )
78
78
types = types . reject { |type | type . is_a? ( Types ::Bases ::Nil ) }
79
79
type = types . one? ? types . first : Types ::Union . new ( types :, location : nil ) #: Types::t
80
80
Original file line number Diff line number Diff line change 4
4
5
5
module TraceHelper
6
6
# @rbs (String) { (Module) -> void } -> void
7
- def load_source ( source , & block )
7
+ def load_source ( source )
8
8
tf = Tempfile . open ( [ "" , ".rb" ] ) do |fp |
9
9
fp . write ( source )
10
10
fp
11
11
end
12
12
mod = Module . new
13
13
load ( tf . path , mod )
14
14
15
- block . call ( mod )
15
+ yield ( mod )
16
16
end
17
17
end
18
18
You can’t perform that action at this time.
0 commit comments