mirror of
https://github.com/Hmbown/DeepSeek-TUI.git
synced 2026-09-03 06:50:13 +08:00
chore: land the bounded dead-code slice and stop the wall regrowing
#4785 asks for a 481-attribute sweep. This is not that sweep — it is the part that can land without judgment calls, plus the gate that makes the sweep worth doing. The measurements are why the gate comes first: issue filed 464 attributes / 143 files 2026-07-26 426 / 111 2026-07-28 481 / 155 The sweep was working and the total still rose, because two large landings this week added state whose accessors only their own tests read. A sweep is a snapshot; a budget is a direction. scripts/check-dead-code-budget.py counts `allow(dead_code)` across crates/ and fails when the total exceeds a committed ceiling. Lowering it is free; raising it needs `--update` and a sentence in the PR, so growth becomes a visible decision rather than an accident. On failure it prints per-crate now-vs-budget and marks which crate grew. Wired into Lint next to the other check-*.py gates. This covers a real blind spot: CI's clippy runs without `--all-targets`, so it never lints cfg(test) or integration-test code — and a prior strip-and-check measured 197 attributes alive *only* because a test references them. The three zero-risk removals from the issue's cluster list: - `codew_legacy_shim.rs` -> `codew.rs`. The issue calls this out as a rename, not a deletion: it is the live `codew` binary and its own docs call it permanent. Every sweep flags the filename; the binary name is unchanged. - `clap` dropped from app-server and `thiserror` from lane — no source in either crate references them. Cargo.lock loses exactly those two edges and no package versions move. The budget baseline is recorded at today's 482, not at an aspirational number, so the gate starts truthful and the sweep can ratchet it down.
This commit is contained in:
10
scripts/dead-code-budget.json
Normal file
10
scripts/dead-code-budget.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"_comment": "Ceiling for `#[allow(dead_code)]` across crates/. This number may go down freely; raising it needs a reviewer to say why in the PR. Regenerate with: python3 scripts/check-dead-code-budget.py --update",
|
||||
"_issue": "https://github.com/Hmbown/CodeWhale/issues/4785",
|
||||
"total": 482,
|
||||
"per_crate": {
|
||||
"config": 2,
|
||||
"tools": 2,
|
||||
"tui": 478
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user