rubocop-on-rbs 0.7.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4d3028aa7f179da033cd2e9bebee2f82b22f38cfece0af39f4407964c0c5535
|
4
|
+
data.tar.gz: f04f255a1bffc5e7d73cc5e61145a3d06c94f6009778698404fa9de6d1cfc4e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bd03c784efb63a1fb78de007e8b51458f5eb57ce12b3ead22a302e081a370bbc00bee646806cbdb1c1fbef943399862685b55df4a65694bfac41b080cd1f4c1
|
7
|
+
data.tar.gz: 5572d2671311c0406f5b62f38eee4a7064fdf5b970107009207a10b0196989ff20e3a264d0b3fdd62003dfc5800b106076b26da29b129cd2a8c96bc8e8fa8298
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.7.0] - 2024-06-27
|
4
|
+
|
5
|
+
* Add RBS/Lint/AmbiguousOperatorPrecedence by @ksss in https://github.com/ksss/rubocop-on-rbs/pull/22
|
6
|
+
* Add RBS/Lint/UselessAccessModifier by @ksss in https://github.com/ksss/rubocop-on-rbs/pull/23
|
7
|
+
|
3
8
|
## [0.6.0] - 2024-06-18
|
4
9
|
|
5
10
|
* Fixed problems interfering with other Cop by @ksss in https://github.com/ksss/rubocop-on-rbs/pull/20
|
@@ -22,13 +22,13 @@ module RuboCop
|
|
22
22
|
def on_rbs_new_investigation
|
23
23
|
total = 0
|
24
24
|
processed_source.raw_source.each_line do |line|
|
25
|
-
total += line.
|
25
|
+
total += line.length
|
26
26
|
chomped = line.chomp
|
27
27
|
next unless chomped.end_with?(' ', "\t")
|
28
28
|
|
29
29
|
range = range_between(
|
30
|
-
total - line.
|
31
|
-
total - line.
|
30
|
+
total - line.length + chomped.rstrip.length,
|
31
|
+
total - line.length + chomped.length,
|
32
32
|
)
|
33
33
|
add_offense(range) do |corrector|
|
34
34
|
corrector.remove(range)
|
@@ -20,19 +20,27 @@ module RuboCop
|
|
20
20
|
next if overload.method_type.type_params.empty?
|
21
21
|
|
22
22
|
type_params = overload.method_type.type_params.dup
|
23
|
+
map = type_params.to_h { |param| [param.name, param] }
|
24
|
+
type_params.each do |type_param|
|
25
|
+
if type_param.upper_bound
|
26
|
+
used_variable_in_type(type_param.upper_bound) do |var|
|
27
|
+
map.delete(var.name)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
23
31
|
|
24
32
|
overload.method_type.each_type do |type|
|
25
33
|
used_variable_in_type(type) do |var|
|
26
|
-
|
34
|
+
map.delete(var.name)
|
27
35
|
end
|
28
36
|
end
|
29
|
-
next if
|
37
|
+
next if map.empty?
|
30
38
|
|
31
|
-
|
39
|
+
map.each do |name, type_param|
|
32
40
|
next unless type_param.location
|
33
41
|
|
34
42
|
t = location_to_range(type_param.location[:name])
|
35
|
-
add_offense(t, message: format(MSG, variable:
|
43
|
+
add_offense(t, message: format(MSG, variable: name))
|
36
44
|
end
|
37
45
|
end
|
38
46
|
end
|
data/lib/rubocop/rbs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-on-rbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ksss
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbs
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
|
-
rubygems_version: 3.5.
|
125
|
+
rubygems_version: 3.5.11
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: RuboCop extension for RBS file.
|