rubocop-sorbet 0.7.2 → 0.7.3
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: a0c73cc4c4d3b4982d210699da94d0dca321a93bf95e98579dc32521714e2921
|
4
|
+
data.tar.gz: b9aa475dea9aa87511868680e92fb1ad5dff83a5b8186439179c17371eaf35f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03a722e469cf1796ba965b044475dabbbe2d99a6b0b79efc083d605bd8dd0973ed1d320dbe511241dd6bfad3c9df7acb6354217ded268db5939ad7f8bf7684aa
|
7
|
+
data.tar.gz: 9fd995f27b0881e5ec939da2b0b1a87372bc910faa4f27cbaf0de43c367d877e1c5b077397f80130ec58f1caa7b6047a7c51ea1eb0872f194f118ce27dbfa10d
|
data/Gemfile.lock
CHANGED
@@ -23,25 +23,53 @@ module RuboCop
|
|
23
23
|
"Instead, strive to write interfaces which respect subtyping principles and remove `allow_incompatible`"
|
24
24
|
RESTRICT_ON_SEND = [:override].freeze
|
25
25
|
|
26
|
-
# @!method
|
27
|
-
def_node_matcher(:
|
26
|
+
# @!method sig_dot_override?(node)
|
27
|
+
def_node_matcher(:sig_dot_override?, <<~PATTERN)
|
28
28
|
(send
|
29
|
-
#sig?
|
29
|
+
[!nil? #sig?]
|
30
30
|
:override
|
31
31
|
(hash <$(pair (sym :allow_incompatible) true) ...>)
|
32
32
|
)
|
33
33
|
PATTERN
|
34
34
|
|
35
35
|
# @!method sig?(node)
|
36
|
-
def_node_search
|
36
|
+
def_node_search(:sig?, <<~PATTERN)
|
37
37
|
(send _ :sig ...)
|
38
38
|
PATTERN
|
39
39
|
|
40
|
+
# @!method override?(node)
|
41
|
+
def_node_matcher(:override?, <<~PATTERN)
|
42
|
+
(send
|
43
|
+
_
|
44
|
+
:override
|
45
|
+
(hash <$(pair (sym :allow_incompatible) true) ...>)
|
46
|
+
)
|
47
|
+
PATTERN
|
48
|
+
|
40
49
|
def on_send(node)
|
41
|
-
|
50
|
+
sig_dot_override?(node) do |allow_incompatible_pair|
|
42
51
|
add_offense(allow_incompatible_pair)
|
43
52
|
end
|
44
53
|
end
|
54
|
+
|
55
|
+
def on_block(node)
|
56
|
+
return unless sig?(node.send_node)
|
57
|
+
|
58
|
+
block = node.children.last
|
59
|
+
return unless block.send_type?
|
60
|
+
|
61
|
+
receiver = block.receiver
|
62
|
+
while receiver
|
63
|
+
allow_incompatible_pair = override?(receiver)
|
64
|
+
if allow_incompatible_pair
|
65
|
+
add_offense(allow_incompatible_pair)
|
66
|
+
break
|
67
|
+
end
|
68
|
+
receiver = receiver.receiver
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
alias_method :on_numblock, :on_block
|
45
73
|
end
|
46
74
|
end
|
47
75
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-sorbet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ufuk Kayserilioglu
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2023-08-
|
14
|
+
date: 2023-08-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
154
|
requirements: []
|
155
|
-
rubygems_version: 3.4.
|
155
|
+
rubygems_version: 3.4.18
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: Automatic Sorbet code style checking tool.
|