spoom 1.7.11 → 1.7.12

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: dcd8a922c433ab7b03fd7d6a419205e983467d5437eed8a078e57835f2168eec
4
- data.tar.gz: 2a74d166079aa6c1f7a2f95dca5de050f6d40b4a49eb43e2eaa7059df1275e7a
3
+ metadata.gz: e5cf816e6ecd86209b75a94d71474288762d94b97da6e6637f2b67bb80c5fcf0
4
+ data.tar.gz: fafeb36ec7993a9632dfa0e7c1b47b7e671122e2e0a89358b1c1ab86dd611aca
5
5
  SHA512:
6
- metadata.gz: b735c17851bebe3875bc1023e799060146de1965b5d3dca786e2868b68d5d27ff0e0e13324c2c6762581eb176d036b078d7168378e0f7b1637e69084e5e9a2ab
7
- data.tar.gz: 9e4730cd210bdef36bed6f610e7b56815fd7d6cad3bf791c8b628f2c5db08e29111e9e7d6a414af8af3612d739d8431ea7461b1205fff6d339f05b4116cc3560
6
+ metadata.gz: a28c07c9f9ddbd22a754d6f4619696d6a82caa6f8b355dd99fc90b27c42c14b8bbb4377e433ad593b7133fffe8397fa929c75e9d309dd9499a7aa105b2126fcb
7
+ data.tar.gz: a098d8d9fba5cef4988d5e3e5fdc01493beec8c3ddd3a75e1b78353570872d447ab82f47a83d2cc3192b6f3699a7409f45b848e29d373eee03d273647e0afacf
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "minitest"
9
+ gem "minitest-mock"
9
10
 
10
11
  group :development do
11
12
  gem "debug"
data/README.md CHANGED
@@ -377,6 +377,24 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
377
377
 
378
378
  To install this gem onto your local machine, run `bundle exec rake install`.
379
379
 
380
+ ## Releasing
381
+
382
+ ### Bump the gem version
383
+
384
+ - [ ] Locally, update the version number in [`version.rb`](https://github.com/Shopify/spoom/blob/main/lib/spoom/version.rb)
385
+ - [ ] Run `bundle install` to update the version number in `Gemfile.lock`
386
+ - [ ] Commit this change with the message `Bump version to vx.y.z`
387
+ - [ ] Push this change directly to main or open a PR
388
+
389
+ ### Create a new tag
390
+
391
+ - [ ] Locally, create a new tag with the new version number: `git tag vx.y.z`
392
+ - [ ] Push this tag up to the remote `git push origin vx.y.z`
393
+
394
+ ### Release workflow will run automatically
395
+
396
+ We have a [release workflow](https://github.com/Shopify/spoom/actions/workflows/release.yml) that will publish your new gem version to rubygems.org via [Trusted Publishing](https://guides.rubygems.org/trusted-publishing/). This workflow must be approved by a member of the Ruby and Rails Infrastructure team at Shopify before it will run. Once it is approved, it will automatically publish a new gem version to rubygems.org and create a new GitHub release.
397
+
380
398
  ## Contributing
381
399
 
382
400
  Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/spoom. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -3,8 +3,6 @@
3
3
 
4
4
  module Spoom
5
5
  module BundlerHelper
6
- extend T::Sig
7
-
8
6
  class << self
9
7
  # Generate a gem requirement for the given gem name, using that gem's version in the "real" current bundle.
10
8
  #
@@ -59,7 +59,7 @@ module Spoom
59
59
  .select { |key, _value| key.start_with?("rbs_") }
60
60
  .sort_by { |_key, value| -value }
61
61
  .each do |key, value|
62
- say(" * #{key}: `#{value}`")
62
+ say(" * #{key}: `#{value}`")
63
63
  end
64
64
  end
65
65
  end
@@ -4,14 +4,14 @@
4
4
  module Spoom
5
5
  # Build a file hierarchy from a set of file paths.
6
6
  class FileTree
7
- #: (?T::Enumerable[String] paths) -> void
7
+ #: (?Enumerable[String] paths) -> void
8
8
  def initialize(paths = [])
9
9
  @roots = {} #: Hash[String, Node]
10
10
  add_paths(paths)
11
11
  end
12
12
 
13
13
  # Add all `paths` to the tree
14
- #: (T::Enumerable[String] paths) -> void
14
+ #: (Enumerable[String] paths) -> void
15
15
  def add_paths(paths)
16
16
  paths.each { |path| add_path(path) }
17
17
  end
@@ -139,6 +139,12 @@ module Spoom
139
139
 
140
140
  apply_member_annotations(comments.method_annotations, sig)
141
141
 
142
+ # Sorbet runtime doesn't support `sig` on `method_added` or
143
+ # `singleton_method_added`, so we always use `without_runtime` for them.
144
+ if def_node.name == :method_added || def_node.name == :singleton_method_added
145
+ sig.without_runtime = true
146
+ end
147
+
142
148
  @rewriter << Source::Replace.new(
143
149
  signature.location.start_offset,
144
150
  signature.location.end_offset,
@@ -202,6 +208,9 @@ module Spoom
202
208
  signatures = comments.signatures
203
209
  if signatures.any?
204
210
  signatures.each do |signature|
211
+ # Only type param signatures (e.g. `#: [A, B]`) are valid on class/module nodes
212
+ next unless signature.string.start_with?("[")
213
+
205
214
  type_params = ::RBS::Parser.parse_type_params(signature.string)
206
215
  next if type_params.empty?
207
216
 
data/lib/spoom/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Spoom
5
- VERSION = "1.7.11"
5
+ VERSION = "1.7.12"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spoom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.11
4
+ version: 1.7.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Terrasa
@@ -99,14 +99,14 @@ dependencies:
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: 4.0.0.dev.4
102
+ version: 4.0.0.dev.5
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: 4.0.0.dev.4
109
+ version: 4.0.0.dev.5
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: rexml
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -275,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
275
275
  - !ruby/object:Gem::Version
276
276
  version: '0'
277
277
  requirements: []
278
- rubygems_version: 3.6.7
278
+ rubygems_version: 4.0.3
279
279
  specification_version: 4
280
280
  summary: Useful tools for Sorbet enthusiasts.
281
281
  test_files: []