rubocop-rbs_inline 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/rubocop/cop/style/rbs_inline/data_class_comment_alignment.rb +1 -1
- data/lib/rubocop/cop/style/rbs_inline/missing_data_class_annotation.rb +1 -1
- data/lib/rubocop/cop/style/rbs_inline/missing_type_annotation.rb +10 -0
- data/lib/rubocop/cop/style/rbs_inline/parameters_separator.rb +2 -0
- data/lib/rubocop/rbs_inline/version.rb +1 -1
- data/rbs_collection.lock.yaml +18 -14
- data/sig/rubocop/cop/style/rbs_inline/missing_type_annotation.rbs +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c49186b8eccbf2e04581f828318839da5405951bf81833fc895eca366d850b8
|
|
4
|
+
data.tar.gz: 6e56027b2905e92da5bbc9ec5f16cfb92027f9a6fce03f15ff9a23b40fb95929
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dda3647518169c8fc20fd69e240c762315a7d2483c8bf58a771cb3f3287f366a1dce929a5fc456e2d48c4ad3b8e0a78cc062c6895cb2159738d6326100586fb8
|
|
7
|
+
data.tar.gz: 254f949c7b20a84c115ccbae0b10c23dbcf082ad56065170cb048a25a143eb42d6a3733fa12b85dc315c7b79c2d30c1e45bf3f6af2a620c9a2e7844e1eb8271b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.5 (2026-05-19)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
- **Style/RbsInline/ParametersSeparator**: No longer reports false positives for `# @rbs` method type signature annotations such as `# @rbs (Type) -> ReturnType` or `# @rbs [T] (T) -> T`.
|
|
8
|
+
- **Style/RbsInline/MissingTypeAnnotation**: Recognizes `# @rbs` method type signature annotations (e.g. `# @rbs (Type) -> ReturnType`) as satisfying the `method_type_signature` and `method_type_signature_or_return_annotation` styles.
|
|
9
|
+
|
|
3
10
|
## 1.5.4 (2026-03-30)
|
|
4
11
|
|
|
5
12
|
### Internal
|
|
@@ -281,6 +281,7 @@ module RuboCop
|
|
|
281
281
|
# @rbs node: RuboCop::AST::DefNode
|
|
282
282
|
def check_method_type_signature(node) #: void
|
|
283
283
|
return if find_method_type_signature_comments(node.location.line)
|
|
284
|
+
return if rbs_method_type_annotation?(node.location.line)
|
|
284
285
|
|
|
285
286
|
add_offense(offense_range_for_def(node), message: METHOD_TYPE_SIGNATURE_MESSAGE)
|
|
286
287
|
end
|
|
@@ -298,6 +299,7 @@ module RuboCop
|
|
|
298
299
|
def check_method_type_signature_or_return_annotation(node) #: void
|
|
299
300
|
return if find_method_type_signature_comments(node.location.line)
|
|
300
301
|
return if find_trailing_comment(method_parameter_list_end_line(node))
|
|
302
|
+
return if rbs_method_type_annotation?(node.location.line)
|
|
301
303
|
|
|
302
304
|
add_offense(offense_range_for_def(node), message: METHOD_TYPE_SIGNATURE_OR_RETURN_ANNOTATION_MESSAGE)
|
|
303
305
|
end
|
|
@@ -393,6 +395,14 @@ module RuboCop
|
|
|
393
395
|
annotation.comments.any? { |c| c.location.slice.match?(/\A#\s+@rbs\s+(skip|override)\b/) }
|
|
394
396
|
end
|
|
395
397
|
|
|
398
|
+
# @rbs line: Integer
|
|
399
|
+
def rbs_method_type_annotation?(line) #: bool
|
|
400
|
+
annotation = find_leading_annotation(line)
|
|
401
|
+
return false unless annotation
|
|
402
|
+
|
|
403
|
+
annotation.each_annotation.any?(RBS::Inline::AST::Annotations::Method)
|
|
404
|
+
end
|
|
405
|
+
|
|
396
406
|
# Returns acceptable annotation name variants for the parameter, or nil for unrecognized types.
|
|
397
407
|
# @rbs argument: RuboCop::AST::Node
|
|
398
408
|
# @rbs name: String
|
|
@@ -51,6 +51,8 @@ module RuboCop
|
|
|
51
51
|
return true if RBS_INLINE_KEYWORDS.include?(matched)
|
|
52
52
|
return true if RBS_INLINE_REGEXP_KEYWORDS.any? { |regexp| matched =~ regexp }
|
|
53
53
|
return true if matched.end_with?(':')
|
|
54
|
+
# method type signature, e.g. `# @rbs (Integer) -> String` or `# @rbs [T] (T) -> T`
|
|
55
|
+
return true if matched.start_with?('(', '[')
|
|
54
56
|
|
|
55
57
|
false
|
|
56
58
|
end
|
data/rbs_collection.lock.yaml
CHANGED
|
@@ -6,7 +6,7 @@ gems:
|
|
|
6
6
|
source:
|
|
7
7
|
type: git
|
|
8
8
|
name: ruby/gem_rbs_collection
|
|
9
|
-
revision:
|
|
9
|
+
revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
|
|
10
10
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
11
11
|
repo_dir: gems
|
|
12
12
|
- name: diff-lcs
|
|
@@ -14,7 +14,7 @@ gems:
|
|
|
14
14
|
source:
|
|
15
15
|
type: git
|
|
16
16
|
name: ruby/gem_rbs_collection
|
|
17
|
-
revision:
|
|
17
|
+
revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
|
|
18
18
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
19
19
|
repo_dir: gems
|
|
20
20
|
- name: fileutils
|
|
@@ -30,13 +30,17 @@ gems:
|
|
|
30
30
|
source:
|
|
31
31
|
type: git
|
|
32
32
|
name: ruby/gem_rbs_collection
|
|
33
|
-
revision:
|
|
33
|
+
revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
|
|
34
34
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
35
35
|
repo_dir: gems
|
|
36
36
|
- name: logger
|
|
37
|
-
version: '
|
|
37
|
+
version: '1.7'
|
|
38
38
|
source:
|
|
39
|
-
type:
|
|
39
|
+
type: git
|
|
40
|
+
name: ruby/gem_rbs_collection
|
|
41
|
+
revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
|
|
42
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
43
|
+
repo_dir: gems
|
|
40
44
|
- name: monitor
|
|
41
45
|
version: '0'
|
|
42
46
|
source:
|
|
@@ -50,7 +54,7 @@ gems:
|
|
|
50
54
|
source:
|
|
51
55
|
type: git
|
|
52
56
|
name: ruby/gem_rbs_collection
|
|
53
|
-
revision:
|
|
57
|
+
revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
|
|
54
58
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
55
59
|
repo_dir: gems
|
|
56
60
|
- name: parser
|
|
@@ -58,7 +62,7 @@ gems:
|
|
|
58
62
|
source:
|
|
59
63
|
type: git
|
|
60
64
|
name: ruby/gem_rbs_collection
|
|
61
|
-
revision:
|
|
65
|
+
revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
|
|
62
66
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
63
67
|
repo_dir: gems
|
|
64
68
|
- name: prism
|
|
@@ -70,7 +74,7 @@ gems:
|
|
|
70
74
|
source:
|
|
71
75
|
type: git
|
|
72
76
|
name: ruby/gem_rbs_collection
|
|
73
|
-
revision:
|
|
77
|
+
revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
|
|
74
78
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
75
79
|
repo_dir: gems
|
|
76
80
|
- name: rake
|
|
@@ -78,15 +82,15 @@ gems:
|
|
|
78
82
|
source:
|
|
79
83
|
type: git
|
|
80
84
|
name: ruby/gem_rbs_collection
|
|
81
|
-
revision:
|
|
85
|
+
revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
|
|
82
86
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
83
87
|
repo_dir: gems
|
|
84
88
|
- name: rbs
|
|
85
|
-
version:
|
|
89
|
+
version: 4.0.2
|
|
86
90
|
source:
|
|
87
91
|
type: rubygems
|
|
88
92
|
- name: rbs-inline
|
|
89
|
-
version: 0.
|
|
93
|
+
version: 0.14.0
|
|
90
94
|
source:
|
|
91
95
|
type: rubygems
|
|
92
96
|
- name: rdoc
|
|
@@ -98,7 +102,7 @@ gems:
|
|
|
98
102
|
source:
|
|
99
103
|
type: git
|
|
100
104
|
name: ruby/gem_rbs_collection
|
|
101
|
-
revision:
|
|
105
|
+
revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
|
|
102
106
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
103
107
|
repo_dir: gems
|
|
104
108
|
- name: rubocop
|
|
@@ -106,7 +110,7 @@ gems:
|
|
|
106
110
|
source:
|
|
107
111
|
type: git
|
|
108
112
|
name: ruby/gem_rbs_collection
|
|
109
|
-
revision:
|
|
113
|
+
revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
|
|
110
114
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
111
115
|
repo_dir: gems
|
|
112
116
|
- name: rubocop-ast
|
|
@@ -114,7 +118,7 @@ gems:
|
|
|
114
118
|
source:
|
|
115
119
|
type: git
|
|
116
120
|
name: ruby/gem_rbs_collection
|
|
117
|
-
revision:
|
|
121
|
+
revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
|
|
118
122
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
119
123
|
repo_dir: gems
|
|
120
124
|
- name: strscan
|
|
@@ -246,6 +246,9 @@ module RuboCop
|
|
|
246
246
|
# @rbs line: Integer
|
|
247
247
|
def skip_annotation?: (Integer line) -> bool
|
|
248
248
|
|
|
249
|
+
# @rbs line: Integer
|
|
250
|
+
def rbs_method_type_annotation?: (Integer line) -> bool
|
|
251
|
+
|
|
249
252
|
# Returns acceptable annotation name variants for the parameter, or nil for unrecognized types.
|
|
250
253
|
# @rbs argument: RuboCop::AST::Node
|
|
251
254
|
# @rbs name: String
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubocop-rbs_inline
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Takeshi KOMIYA
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-05-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lint_roller
|