rubocop-lts-ruby 0.1.1 → 0.1.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: 29077e2a4e3cc7489fe32210f110ffe2cbce2f07967a5db4067a17c76e344386
4
- data.tar.gz: 9da519abc67190594d570dd1594bdb271450915375211ae9729a284f3e588dce
3
+ metadata.gz: 50966987c63662ef0e15c5b9d7c2824508f605a6811e0e90f1bf16bd3ebf5c24
4
+ data.tar.gz: 7db7a8fa808740f505fa77b0cd151f285aa4c3e0e98caa3463f98146a6defcb4
5
5
  SHA512:
6
- metadata.gz: be2d3c952a9d3e163ae7b902b7594d3095c484d36c63c6db7a63817c0c3aa0b711c3e0e62e2b1084808d8199499ac570a18d64d983cede497a24a63b465852cf
7
- data.tar.gz: 13a486094c57ff25b41d7759596050ef0915086f4c7007905e1a4a0fe496a64e5e693352b0d4e89973dbe26632fa5a6177a73e59b1ea27f325eb154407be3079
6
+ metadata.gz: 41ed9fe945838de4162d1d9623339dd3cc7ffdc56d0aaebcadeabe0b906de51c5be4de17de06a7c9d8d2d744323790b06677f019f4fc7d1f4be9748d8a6e8736
7
+ data.tar.gz: 80c86ab1748486c4e8e4b3e8c8438ab79a433e6d40196b192e2790ff2ba9d406aa7fdf9e458cd15c5a33bada28ecc902f07a8364b0a3bf9f1c32b1248cdc9b5e
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,17 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.1.2] - 2026-09-07
34
+
35
+ - TAG: [v0.1.2][0.1.2t]
36
+ - COVERAGE: 97.47% -- 77/79 lines in 6 files
37
+ - BRANCH COVERAGE: 78.57% -- 11/14 branches in 6 files
38
+ - 44.44% documented
39
+
40
+ ### Fixed
41
+
42
+ - Avoid false positives for ObjectSpace::WeakMap delete availability checks.
43
+
33
44
  ## [0.1.1] - 2026-09-07
34
45
 
35
46
  - TAG: [v0.1.1][0.1.1t]
@@ -139,7 +150,9 @@ Please file a bug if you notice a violation of semantic versioning.
139
150
 
140
151
  - Generated dep-heads workflows now include their checked-in appraisal Gemfile, and Ruby 3.1 stdlib appraisal references resolve to an existing modular Gemfile.
141
152
 
142
- [Unreleased]: https://github.com/rubocop-lts/rubocop-lts-ruby/compare/v0.1.1...HEAD
153
+ [Unreleased]: https://github.com/rubocop-lts/rubocop-lts-ruby/compare/v0.1.2...HEAD
154
+ [0.1.2]: https://github.com/rubocop-lts/rubocop-lts-ruby/compare/v0.1.1...v0.1.2
155
+ [0.1.2t]: https://github.com/rubocop-lts/rubocop-lts-ruby/releases/tag/v0.1.2
143
156
  [0.1.1]: https://github.com/rubocop-lts/rubocop-lts-ruby/compare/v0.1.0...v0.1.1
144
157
  [0.1.1t]: https://github.com/rubocop-lts/rubocop-lts-ruby/releases/tag/v0.1.1
145
158
  [0.1.0]: https://github.com/rubocop-lts/rubocop-lts-ruby/compare/968b2f62d3056d967753b1ee4fcdc3c958553b87...v0.1.0
data/README.md CHANGED
@@ -500,7 +500,7 @@ Thanks for RTFM. ☺️
500
500
  [📌gitmoji]: https://gitmoji.dev
501
501
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
502
502
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
503
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.076-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
503
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.079-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
504
504
  [🔐security]: https://github.com/rubocop-lts/rubocop-lts-ruby/blob/main/SECURITY.md
505
505
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
506
506
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -237,7 +237,7 @@ module RuboCop
237
237
  entry("Object", :then, "2.6"),
238
238
  entry("Object", :yield_self, "2.5"),
239
239
  entry("ObjectSpace", :reachable_objects_from, "2.0", receiver_type: :constant),
240
- entry("ObjectSpace::WeakMap", :delete, "3.3"),
240
+ entry("ObjectSpace::WeakMap", :delete, "3.3", receiver_type: :constructed_instance),
241
241
  entry("OpenStruct", :[], "2.0"),
242
242
  entry("OpenStruct", :[]=, "2.0"),
243
243
  entry("OpenStruct", :each_pair, "2.0"),
@@ -44,13 +44,24 @@ module RuboCop
44
44
  end
45
45
 
46
46
  def entry_applies?(node, entry)
47
- if entry.receiver_type == :instance
48
- return false if node.receiver.const_type?
49
-
50
- return true
47
+ case entry.receiver_type
48
+ when :instance
49
+ !node.receiver.const_type?
50
+ when :constant
51
+ node.receiver.const_type? && node.receiver.const_name == entry.owner
52
+ when :constructed_instance
53
+ constructed_instance_of?(node.receiver, entry.owner)
54
+ else
55
+ false
51
56
  end
57
+ end
52
58
 
53
- node.receiver.const_type? && node.receiver.const_name == entry.owner
59
+ # A local receiver has no reliable static class in RuboCop's AST. Restrict
60
+ # constructor-only APIs to a directly visible `Owner.new` expression rather
61
+ # than treating every nonconstant receiver as an instance of that owner.
62
+ def constructed_instance_of?(receiver, owner)
63
+ receiver.send_type? && receiver.method?(:new) &&
64
+ receiver.receiver&.const_type? && receiver.receiver.const_name == owner
54
65
  end
55
66
 
56
67
  def report_unavailable(node, entries)
@@ -6,7 +6,7 @@ module RuboCop
6
6
  # Version namespace for this gem.
7
7
  module Version
8
8
  # Current gem version.
9
- VERSION = "0.1.1"
9
+ VERSION = "0.1.2"
10
10
  end
11
11
  # Current gem version exposed at the traditional constant location.
12
12
  VERSION = Version::VERSION # Traditional Constant Location
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-lts-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -320,10 +320,10 @@ licenses:
320
320
  - MIT
321
321
  metadata:
322
322
  homepage_uri: https://github.com/rubocop-lts/rubocop-lts-ruby
323
- source_code_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/tree/v0.1.1
324
- changelog_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/blob/v0.1.1/CHANGELOG.md
323
+ source_code_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/tree/v0.1.2
324
+ changelog_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/blob/v0.1.2/CHANGELOG.md
325
325
  bug_tracker_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/issues
326
- documentation_uri: https://www.rubydoc.info/gems/rubocop-lts-ruby/0.1.1
326
+ documentation_uri: https://www.rubydoc.info/gems/rubocop-lts-ruby/0.1.2
327
327
  funding_uri: https://github.com/sponsors/pboling
328
328
  wiki_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/wiki
329
329
  news_uri: https://www.railsbling.com/tags/rubocop-lts-ruby
metadata.gz.sig CHANGED
Binary file