yard-lint 1.13.0 → 1.13.1
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 +3 -0
- data/lib/yard/lint/validators/base.rb +25 -10
- data/lib/yard/lint/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c16ecb156acd4118a7f6b11de2426ea4194789350e794b300a17a5608ed88c6f
|
|
4
|
+
data.tar.gz: 1700cd0522e3fd7ba3041e170f7a6c6c2d407cac819808571e77907355bbb5ed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69ef7bafbb9c41c27857d0247c30fbcc5dc880663a16f4d90088afa594c4ea3fac8a447e66f041aae501786f91fa5b75a21d83f25679dbbfb8d1ff287709902b
|
|
7
|
+
data.tar.gz: 7089ac1747b1473388efaafdb1e899ac3888fa71f31d696b408b5dcdc924ccd69ebaaa466efba90631e59d42cd9c87522d2ca482d5137e68f6dd089149da2474
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
## 1.13.1 (2026-11-02)
|
|
2
|
+
- **[Bugfix]** `Documentation/UndocumentedBooleanMethods` no longer slows down with the square of the number of methods in a class or module (a module with 4200 methods: about 3 s to 40 ms). The `module_function` twin lookup it shares with the separator, `Tags/OverloadConsistency` and `Documentation/ReferenceTypo` validators now reads the registry by path instead of scanning the namespace's children.
|
|
3
|
+
|
|
1
4
|
## 1.13.0 (2026-10-25)
|
|
2
5
|
- **[Feature]** Added `Tags/OverloadConsistency` (enabled by default, severity `warning`), which checks the tags of each `@overload` against that overload's own signature: a `@param` not in the signature, a parameter without `@param` in an overload that documents others (a method-level `@param` counts for every overload), and an overload without `@return` when other overloads have one.
|
|
3
6
|
- **[Feature]** Added `Documentation/ReferenceTypo` (enabled by default, severity `warning`), which flags probable typos in `{Foo#bar}` links and `@see` targets and suggests the closest name via `DidYouMean`.
|
|
@@ -137,9 +137,8 @@ module Yard
|
|
|
137
137
|
# @return [Boolean] true if the object's docstring is a normalized copy
|
|
138
138
|
def module_function_copy?(object)
|
|
139
139
|
return false unless object.type == :method
|
|
140
|
-
# Checked before the twin lookup
|
|
141
|
-
#
|
|
142
|
-
# is paired with, and most objects are
|
|
140
|
+
# Checked before the twin lookup: an object YARD tracked back to source
|
|
141
|
+
# lines is authored, whatever it is paired with, and most objects are
|
|
143
142
|
return false if object.docstring.line_range
|
|
144
143
|
|
|
145
144
|
twin = module_function_twin(object)
|
|
@@ -155,16 +154,15 @@ module Yard
|
|
|
155
154
|
# when the object does not come from module_function
|
|
156
155
|
def module_function_twin(object)
|
|
157
156
|
return nil unless object.respond_to?(:scope)
|
|
158
|
-
# `def CONST.name` leaves a Proxy
|
|
159
|
-
#
|
|
157
|
+
# Only a module defines module functions; `def CONST.name` leaves a Proxy
|
|
158
|
+
# or ConstantObject namespace. Proxy#is_a? answers for the resolved object
|
|
160
159
|
return nil unless object.namespace.is_a?(YARD::CodeObjects::NamespaceObject)
|
|
161
160
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
)
|
|
161
|
+
# Looked up by path: a children scan per object is quadratic in the
|
|
162
|
+
# number of methods of a namespace
|
|
163
|
+
twin = YARD::Registry.at(module_function_twin_path(object))
|
|
166
164
|
|
|
167
|
-
return nil unless twin
|
|
165
|
+
return nil unless twin.is_a?(YARD::CodeObjects::MethodObject)
|
|
168
166
|
return nil unless twin.file == object.file && twin.line == object.line
|
|
169
167
|
# Both halves point at the same definition, but only the class method
|
|
170
168
|
# is flagged as a module function by YARD.
|
|
@@ -173,6 +171,23 @@ module Yard
|
|
|
173
171
|
twin
|
|
174
172
|
end
|
|
175
173
|
|
|
174
|
+
# Builds the registry path of the method with the same name and the other
|
|
175
|
+
# scope, the way YARD::CodeObjects::MethodObject#path does
|
|
176
|
+
# @param object [YARD::CodeObjects::MethodObject] one half of the pair
|
|
177
|
+
# @return [String] the registry path of the other half
|
|
178
|
+
def module_function_twin_path(object)
|
|
179
|
+
namespace = object.namespace
|
|
180
|
+
|
|
181
|
+
separator =
|
|
182
|
+
if object.scope == :instance
|
|
183
|
+
namespace.root? ? YARD::CodeObjects::NSEP : YARD::CodeObjects::CSEP
|
|
184
|
+
else
|
|
185
|
+
YARD::CodeObjects::ISEP
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
"#{namespace.path}#{separator}#{object.name}"
|
|
189
|
+
end
|
|
190
|
+
|
|
176
191
|
# Converts a zero-based line offset within a docstring's text into an
|
|
177
192
|
# absolute line number in the source file, so offenses can point at
|
|
178
193
|
# the offending documentation line instead of the definition line.
|
data/lib/yard/lint/version.rb
CHANGED