Commit 05ed61c
authored
Remove dead constants and unused AnonClass (#1642)
## Summary
- Remove `RDoc::AnonClass` class and file (documented as "never used")
- Remove `Darkfish::VERSION` (unreferenced)
- Remove `Formatter::InlineTag` struct (unused after inline parser
rewrite)
- Remove `ToHtmlCrossref::CLASS_REGEXP_STR` and `METHOD_REGEXP_STR`
(aliased but unused within the file)
### Process & tools used
1. **Detect candidates** — Used `detect_dead_constants` from
[Rubydex](https://github.com/Shopify/rubydex) to find constants with
zero resolved references in `lib/`. Got 22 candidates.
2. **Filter out false positives** — Grepped for actual usage of each
candidate, catching private constants used internally, dynamic access
via `const_defined?`/`const_get`, default parameters, and generated code
(Racc).
3. **Remove confirmed dead code** — Deleted 5 constants and 1
class+file.
4. **Run full test suite** — Caught that one deletion (`RI::Formatter`)
broke a `require_relative` in `ri/driver.rb`, so restored it. Final run:
2384 tests, 0 failures.1 parent 4a68130 commit 05ed61c
File tree
6 files changed
+0
-26
lines changed- lib
- rdoc
- code_object
- generator
- markup
6 files changed
+0
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | 192 | | |
194 | 193 | | |
195 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | 76 | | |
82 | 77 | | |
83 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 17 | | |
25 | 18 | | |
26 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | | - | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
0 commit comments