yard-lint 1.10.1 → 1.10.2
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/semantic/abstract_methods/validator.rb +13 -1
- 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: e1b9f3a39ce5fb15c2a1ace664e45d393fb70e429220085ebd4a7881aa2496cc
|
|
4
|
+
data.tar.gz: 207fb47ddd283bd62755c6f5736652166caed19a342f601ce78cfe73c0aad5e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7898934b15acdea1b39a244e6224969cef3848427b02db1711c87480ff8459b481920eb6a378fe25296bf0c2dc708d7f3b63ec7c8bd25effb7ea92d8c21179df
|
|
7
|
+
data.tar.gz: cb7525e59baebfe5cbb1e192ed91d38c6c75d04a4fd1ed9c60db1616794e66b67b46b39cefd5fa734565b30bb7bb4419fe672cbe798b2019443c0d5f59e7f7ae
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
## 1.10.2 (2026-07-24)
|
|
2
|
+
- **[Bugfix]** `Semantic/AbstractMethods` no longer flags an `@abstract` method whose body is `fail NotImplementedError`. `fail` is a built-in alias of `raise` (`Kernel#fail`), so `fail NotImplementedError` is an identical abstract-method guard to `raise NotImplementedError`, but the `AllowedImplementations` patterns are written with `raise` and were matched literally. A leading `fail` keyword is now normalized to `raise` before matching, so both forms are recognized (and any custom `raise`-based `AllowedImplementations` pattern automatically covers its `fail` alias). Identifiers such as `failure` and non-leading `fail(...)` calls are left untouched.
|
|
3
|
+
|
|
1
4
|
## 1.10.1 (2026-07-24)
|
|
2
5
|
- **[Bugfix]** `Documentation/BlankLineBeforeDefinition` no longer reports a foreign comment block above a definition as documentation that was accidentally detached from it. When the object is documented (non-empty docstring) but that docstring did not come from the comment block sitting above this definition, the block is not a detached docstring - it is a file-level license/copyright banner, an encoding note, or an unrelated comment above a namespace reopening whose documentation lives in another file. The check compares the object's docstring against the block's text, so it recognizes any such banner without hardcoding its wording. Definitions whose documentation was genuinely lost (an undocumented object with a comment block detached above it) are still reported.
|
|
3
6
|
|
|
@@ -46,7 +46,7 @@ module Yard
|
|
|
46
46
|
has_real_implementation = body_lines.any? do |line|
|
|
47
47
|
next false if line.start_with?('#') || line == 'end'
|
|
48
48
|
|
|
49
|
-
allowed.none? { |pattern| line.match?(pattern) }
|
|
49
|
+
allowed.none? { |pattern| normalize_raise_alias(line).match?(pattern) }
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
return unless has_real_implementation
|
|
@@ -69,6 +69,18 @@ module Yard
|
|
|
69
69
|
end
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
+
# Rewrites a leading `fail` keyword to `raise` so the two are treated alike when
|
|
73
|
+
# matching AllowedImplementations. `fail` is a built-in alias of `raise`
|
|
74
|
+
# (`Kernel#fail`), so `fail NotImplementedError` is an identical abstract-method
|
|
75
|
+
# guard to `raise NotImplementedError`, but the configured patterns are written
|
|
76
|
+
# with `raise`. Only a leading keyword is rewritten, so identifiers such as
|
|
77
|
+
# `failure` or a `fail(...)` call elsewhere in a line are left untouched.
|
|
78
|
+
# @param line [String] a stripped body line
|
|
79
|
+
# @return [String]
|
|
80
|
+
def normalize_raise_alias(line)
|
|
81
|
+
line.sub(/\Afail\b/, 'raise')
|
|
82
|
+
end
|
|
83
|
+
|
|
72
84
|
# Joins lines that are continuations of the previous statement (the
|
|
73
85
|
# previous line ends with a comma or a backslash) into a single
|
|
74
86
|
# logical line.
|
data/lib/yard/lint/version.rb
CHANGED