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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c63ea819ad85e3c0878e26d37ea3b59bb61598804d3963425ff5882931b1a22
4
- data.tar.gz: 5b613e3ba58f6773abd4b47b23c64e94d223ddecde10a743db5de1525b0f5ec2
3
+ metadata.gz: e1b9f3a39ce5fb15c2a1ace664e45d393fb70e429220085ebd4a7881aa2496cc
4
+ data.tar.gz: 207fb47ddd283bd62755c6f5736652166caed19a342f601ce78cfe73c0aad5e9
5
5
  SHA512:
6
- metadata.gz: 608923c037bde8d53573ae6f7d3487d1b156ba04ae94c143675c5c5f6c541ccb6266df7acf1748e7fd54e9e3bb92942a28fd2d62d560b92b6ee6e5373f60c822
7
- data.tar.gz: 91863e353c9be138fa4bd93db36ce4cdf85209a85863dca25f6d7c1f3a794673018946d7e8160fedf801a4c80cf7377359f675462d87c7955aaf4b80fcffa68f
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.
@@ -3,6 +3,6 @@
3
3
  module Yard
4
4
  module Lint
5
5
  # @return [String] version of the YARD Lint gem
6
- VERSION = '1.10.1'
6
+ VERSION = '1.10.2'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.1
4
+ version: 1.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld