You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(code-intel): dead-code should skip tests, trait impls and public library items by default; affected should follow type-resolved edges only #716
cora dead-code lists 944 "potentially dead" symbols; 913 of them are #[test] functions and test helpers (files named *_tests.rs or under tests/), which are called by the test harness and are not dead. Only 31 are not in test files, and the two I checked were false positives (see the macro issue).
Library crates such as tole-core are published, so their pub items are API even without an in-workspace caller; trait implementations are called through dispatch.
cora affected crates/tole-core/src/web.rs returns 118 test files. The real set is web.rs's own inline tests plus a handful of CLI tests. This is a consequence of name-only resolution (a separate issue), but even with correct edges affected needs a granularity rule.
Proposed solution
dead-code defaults: skip #[test], #[cfg(test)] modules, files matching the configured test glob, main, trait implementation methods, and pub items of a lib crate (flag --include-public, --include-tests to add them back). Report a confidence per hit (no edge at all versus only ambiguous edges).
affected: walk only type-resolved call and import edges, stop at depth N (default 3, flag), and report why each test file is included (the shortest edge path), so the list is checkable.
Add a count and the cut-off to the output when a list is truncated.
Alternatives considered
Keep the current behaviour and document that results need checking with grep (the current state). That makes impact, affected and dead-code unusable for decisions.
Activity
fix(code-intel): skip tests, trait impls and lib API in dead-code; ty…