spoom 1.2.2 → 1.2.4

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/lib/spoom/backtrace_filter/minitest.rb +21 -0
  4. data/lib/spoom/cli/coverage.rb +1 -1
  5. data/lib/spoom/context/git.rb +4 -4
  6. data/lib/spoom/context/sorbet.rb +6 -6
  7. data/lib/spoom/deadcode/erb.rb +4 -4
  8. data/lib/spoom/deadcode/indexer.rb +83 -6
  9. data/lib/spoom/deadcode/location.rb +29 -1
  10. data/lib/spoom/deadcode/plugins/action_mailer.rb +21 -0
  11. data/lib/spoom/deadcode/plugins/actionpack.rb +61 -0
  12. data/lib/spoom/deadcode/plugins/active_job.rb +13 -0
  13. data/lib/spoom/deadcode/plugins/active_model.rb +46 -0
  14. data/lib/spoom/deadcode/plugins/active_record.rb +111 -0
  15. data/lib/spoom/deadcode/plugins/active_support.rb +21 -0
  16. data/lib/spoom/deadcode/plugins/base.rb +354 -0
  17. data/lib/spoom/deadcode/plugins/graphql.rb +47 -0
  18. data/lib/spoom/deadcode/plugins/minitest.rb +28 -0
  19. data/lib/spoom/deadcode/plugins/namespaces.rb +34 -0
  20. data/lib/spoom/deadcode/plugins/rails.rb +31 -0
  21. data/lib/spoom/deadcode/plugins/rake.rb +12 -0
  22. data/lib/spoom/deadcode/plugins/rspec.rb +19 -0
  23. data/lib/spoom/deadcode/plugins/rubocop.rb +41 -0
  24. data/lib/spoom/deadcode/plugins/ruby.rb +65 -0
  25. data/lib/spoom/deadcode/plugins/sorbet.rb +46 -0
  26. data/lib/spoom/deadcode/plugins/thor.rb +21 -0
  27. data/lib/spoom/deadcode/plugins.rb +95 -0
  28. data/lib/spoom/deadcode/remover.rb +616 -0
  29. data/lib/spoom/deadcode/send.rb +22 -0
  30. data/lib/spoom/deadcode.rb +8 -6
  31. data/lib/spoom/sorbet/lsp.rb +2 -2
  32. data/lib/spoom/sorbet/sigils.rb +2 -2
  33. data/lib/spoom/sorbet.rb +1 -0
  34. data/lib/spoom/version.rb +1 -1
  35. metadata +24 -18
@@ -28,7 +28,7 @@ module Spoom
28
28
  T::Array[String],
29
29
  )
30
30
 
31
- SIGIL_REGEXP = T.let(/^#[\ t]*typed[\ t]*:[ \t]*(\w*)[ \t]*/, Regexp)
31
+ SIGIL_REGEXP = T.let(/^#[[:blank:]]*typed:[[:blank:]]*(\S*)/, Regexp)
32
32
 
33
33
  class << self
34
34
  extend T::Sig
@@ -61,7 +61,7 @@ module Spoom
61
61
  # * returns nil if no sigil
62
62
  sig { params(path: T.any(String, Pathname)).returns(T.nilable(String)) }
63
63
  def file_strictness(path)
64
- return nil unless File.file?(path)
64
+ return unless File.file?(path)
65
65
 
66
66
  content = File.read(path, encoding: Encoding::ASCII_8BIT)
67
67
  strictness_in_content(content)
data/lib/spoom/sorbet.rb CHANGED
@@ -35,6 +35,7 @@ module Spoom
35
35
 
36
36
  CONFIG_PATH = "sorbet/config"
37
37
  GEM_PATH = T.let(Gem::Specification.find_by_name("sorbet-static").full_gem_path, String)
38
+ GEM_VERSION = T.let(Gem::Specification.find_by_name("sorbet-static-and-runtime").version.to_s, String)
38
39
  BIN_PATH = T.let((Pathname.new(GEM_PATH) / "libexec" / "sorbet").to_s, String)
39
40
 
40
41
  KILLED_CODE = 137
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.2.2"
5
+ VERSION = "1.2.4"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spoom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Terrasa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-21 00:00:00.000000000 Z
11
+ date: 2023-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.10.0
83
83
  - !ruby/object:Gem::Dependency
84
- name: sorbet
84
+ name: sorbet-static-and-runtime
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.5.10187
97
- - !ruby/object:Gem::Dependency
98
- name: sorbet-runtime
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: 0.5.9204
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: 0.5.9204
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: syntax_tree
113
99
  requirement: !ruby/object:Gem::Requirement
@@ -149,6 +135,7 @@ files:
149
135
  - Rakefile
150
136
  - exe/spoom
151
137
  - lib/spoom.rb
138
+ - lib/spoom/backtrace_filter/minitest.rb
152
139
  - lib/spoom/cli.rb
153
140
  - lib/spoom/cli/bump.rb
154
141
  - lib/spoom/cli/config.rb
@@ -177,7 +164,26 @@ files:
177
164
  - lib/spoom/deadcode/index.rb
178
165
  - lib/spoom/deadcode/indexer.rb
179
166
  - lib/spoom/deadcode/location.rb
167
+ - lib/spoom/deadcode/plugins.rb
168
+ - lib/spoom/deadcode/plugins/action_mailer.rb
169
+ - lib/spoom/deadcode/plugins/actionpack.rb
170
+ - lib/spoom/deadcode/plugins/active_job.rb
171
+ - lib/spoom/deadcode/plugins/active_model.rb
172
+ - lib/spoom/deadcode/plugins/active_record.rb
173
+ - lib/spoom/deadcode/plugins/active_support.rb
174
+ - lib/spoom/deadcode/plugins/base.rb
175
+ - lib/spoom/deadcode/plugins/graphql.rb
176
+ - lib/spoom/deadcode/plugins/minitest.rb
177
+ - lib/spoom/deadcode/plugins/namespaces.rb
178
+ - lib/spoom/deadcode/plugins/rails.rb
179
+ - lib/spoom/deadcode/plugins/rake.rb
180
+ - lib/spoom/deadcode/plugins/rspec.rb
181
+ - lib/spoom/deadcode/plugins/rubocop.rb
182
+ - lib/spoom/deadcode/plugins/ruby.rb
183
+ - lib/spoom/deadcode/plugins/sorbet.rb
184
+ - lib/spoom/deadcode/plugins/thor.rb
180
185
  - lib/spoom/deadcode/reference.rb
186
+ - lib/spoom/deadcode/remover.rb
181
187
  - lib/spoom/deadcode/send.rb
182
188
  - lib/spoom/file_collector.rb
183
189
  - lib/spoom/file_tree.rb
@@ -216,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
222
  - !ruby/object:Gem::Version
217
223
  version: '0'
218
224
  requirements: []
219
- rubygems_version: 3.4.14
225
+ rubygems_version: 3.4.19
220
226
  signing_key:
221
227
  specification_version: 4
222
228
  summary: Useful tools for Sorbet enthusiasts.