debride 1.15.1 → 1.15.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
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +8 -0
- data/lib/debride.rb +11 -2
- data/test/test_debride.rb +12 -0
- data.tar.gz.sig +0 -0
- metadata +20 -5
- metadata.gz.sig +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2a172fbacd06e56a051cb02614afd1abe8f6d58a89e2fbf316e981b7d984ad2
|
|
4
|
+
data.tar.gz: ad77390a37d25f0d3af9d7c8b399151ad653321117020b029b15cd1e587b94eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 03610f92787f0dc2e44af469f11582a6a2f4a6463e210b0c79e01c9294c89fe6dd37c2147f6ad1476c6a125a1238efb1c742ac9c29844b2fabad4e27bc60e878
|
|
7
|
+
data.tar.gz: 6c21f8d4c056aff81158115b7a12880537a96e52d40913ffea8a43ab900eed95f58c2a9c7bd200cf721ed32c981cae7b3c6d1df7f9cfbd6cda8ef4a4c418f314
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/History.rdoc
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
=== 1.15.2 / 2026-04-20
|
|
2
|
+
|
|
3
|
+
* 3 bug fixes:
|
|
4
|
+
|
|
5
|
+
* Fix #process_hash when there's a kwsplat in the middle. (carlos-musetti)
|
|
6
|
+
* Rescue StandardError in .run to handle wider gamut of errors gracefully.
|
|
7
|
+
* Add #process override to handle errors as well.
|
|
8
|
+
|
|
1
9
|
=== 1.15.1 / 2026-01-26
|
|
2
10
|
|
|
3
11
|
* 1 bug fix:
|
data/lib/debride.rb
CHANGED
|
@@ -15,7 +15,7 @@ require "prism/translation/ruby_parser"
|
|
|
15
15
|
# A static code analyzer that points out possible dead methods.
|
|
16
16
|
|
|
17
17
|
class Debride < MethodBasedSexpProcessor
|
|
18
|
-
VERSION = "1.15.
|
|
18
|
+
VERSION = "1.15.2" # :nodoc:
|
|
19
19
|
PROJECT = "debride"
|
|
20
20
|
|
|
21
21
|
NotRubyParser = Class.new Prism::Translation::RubyParser # compatibility layer :nodoc:
|
|
@@ -82,12 +82,18 @@ class Debride < MethodBasedSexpProcessor
|
|
|
82
82
|
|
|
83
83
|
begin
|
|
84
84
|
process send(msg, file)
|
|
85
|
-
rescue
|
|
85
|
+
rescue StandardError, SyntaxError => e
|
|
86
86
|
warn " skipping #{file}: #{e.message}"
|
|
87
87
|
end
|
|
88
88
|
end
|
|
89
89
|
end
|
|
90
90
|
|
|
91
|
+
def process exp # :nodoc:
|
|
92
|
+
super
|
|
93
|
+
rescue => e # override to capture these but move on
|
|
94
|
+
warn " skipping: #{e.message}"
|
|
95
|
+
end
|
|
96
|
+
|
|
91
97
|
def process_rb path_or_io
|
|
92
98
|
warn "Processing ruby: #{path_or_io}" if option[:verbose]
|
|
93
99
|
|
|
@@ -485,6 +491,9 @@ class Debride < MethodBasedSexpProcessor
|
|
|
485
491
|
def process_hash sexp
|
|
486
492
|
_, *pairs = sexp
|
|
487
493
|
|
|
494
|
+
# pad kwsplat to survive each_slice 2
|
|
495
|
+
pairs = pairs.flat_map { |s| s && s.sexp_type == :kwsplat ? [s, nil] : [s] }
|
|
496
|
+
|
|
488
497
|
pairs.each_slice 2 do |k, v|
|
|
489
498
|
if v.nil? && k.sexp_type == :lit then
|
|
490
499
|
called << k.last
|
data/test/test_debride.rb
CHANGED
|
@@ -425,6 +425,18 @@ class TestDebride < Minitest::Test
|
|
|
425
425
|
assert_process [["Seattle", [:raining]]], ruby
|
|
426
426
|
end
|
|
427
427
|
|
|
428
|
+
def test_hash__kwsplat_bug
|
|
429
|
+
ruby = <<~RUBY
|
|
430
|
+
{
|
|
431
|
+
a:,
|
|
432
|
+
**b,
|
|
433
|
+
c:,
|
|
434
|
+
}
|
|
435
|
+
RUBY
|
|
436
|
+
|
|
437
|
+
assert_process [], ruby
|
|
438
|
+
end
|
|
439
|
+
|
|
428
440
|
def test_safe_navigation_operator
|
|
429
441
|
ruby = <<-RUBY.strip
|
|
430
442
|
class Seattle
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: debride
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.15.
|
|
4
|
+
version: 1.15.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Davis
|
|
@@ -112,15 +112,29 @@ dependencies:
|
|
|
112
112
|
requirements:
|
|
113
113
|
- - "~>"
|
|
114
114
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: '4.
|
|
115
|
+
version: '4.6'
|
|
116
116
|
type: :development
|
|
117
117
|
prerelease: false
|
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
|
119
119
|
requirements:
|
|
120
120
|
- - "~>"
|
|
121
121
|
- !ruby/object:Gem::Version
|
|
122
|
-
version: '4.
|
|
123
|
-
description:
|
|
122
|
+
version: '4.6'
|
|
123
|
+
description: |-
|
|
124
|
+
Analyze code for potentially uncalled / dead methods, now with auto-removal.
|
|
125
|
+
|
|
126
|
+
== Features/Problems:
|
|
127
|
+
|
|
128
|
+
* Static analysis of code. Can be easily hooked up to a CI.
|
|
129
|
+
* As with all static analysis tools of dynamic languages, can't be 100%.
|
|
130
|
+
* Whitelisting known good methods by name or regexp.
|
|
131
|
+
* Use --rails for Rails-specific domain knowledge.
|
|
132
|
+
* Use debride_rm to brazenly remove all unused methods. BE CAREFUL.
|
|
133
|
+
* Use `debride_rails_whitelist` to generate an emperical whitelist from logs.
|
|
134
|
+
* Uses path_expander, so you can use:
|
|
135
|
+
* dir_arg -- expand a directory automatically
|
|
136
|
+
* @file_of_args -- persist arguments in a file
|
|
137
|
+
* -path_to_subtract -- ignore intersecting subsets of files/directories
|
|
124
138
|
email:
|
|
125
139
|
- ryand-ruby@zenspider.com
|
|
126
140
|
executables:
|
|
@@ -148,6 +162,7 @@ licenses:
|
|
|
148
162
|
- MIT
|
|
149
163
|
metadata:
|
|
150
164
|
homepage_uri: https://github.com/seattlerb/debride
|
|
165
|
+
documentation_uri: http://docs.seattlerb.org/debride
|
|
151
166
|
rdoc_options:
|
|
152
167
|
- "--main"
|
|
153
168
|
- README.rdoc
|
|
@@ -166,5 +181,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
166
181
|
requirements: []
|
|
167
182
|
rubygems_version: 3.7.2
|
|
168
183
|
specification_version: 4
|
|
169
|
-
summary: Analyze code for potentially uncalled / dead methods, now with auto-removal
|
|
184
|
+
summary: Analyze code for potentially uncalled / dead methods, now with auto-removal
|
|
170
185
|
test_files: []
|
metadata.gz.sig
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
.����B'$���4��v8������цX��/�s@�S��h������ȑ�>ow�/�5��������r����o�_�oq@e��;p��vֲ�l��9�识`Ke�}-�$�TV�I#O�.#����P5�������v���
|
|
2
|
+
��pVv�@�����a T�y�Y{���[�j�%��X�K��/S��=�2����?����(z@&;ng�h�thUI�DIr�y E��Zr�V�+ߗ[�n�w�l�D�
|