Users praise the Hawk tool for detecting dead Rust code across Cargo workspaces as empirically useful despite not reviewing the code, and thank its creators for the innovative experiment.
Based on 2 visible X reactions from 2 accounts; directional sample.
Ask a question below.
Published answers will appear here.
Building this was in part an experiment. I haven't "read" any of the code in this codebase, and yet it is empirically a really useful thing. We now run it continuously in uv's CI.
@GrantSlatton Very nice, thank you! I’ll do some of these
In uv, we are (with a few exceptions) our only caller, so we can analyze the workspace as a closed world. In other words, `pub` code that's unused across the workspace can be considered dead code. Hawk can identify and remove that code.
Similarly, code that's marked as `pub` but isn't used by any other crates can have its visibility downgraded. Same for struct fields, etc. (Hawk can enforce and fix this too.)
rustc can identify unused code within a crate, but (sensibly) assumes that anything `pub` might be used by external callers...
@GrantSlatton If it works well, I wrote it. If not, GPT wrote it.
Users praise the Hawk tool for detecting dead Rust code across Cargo workspaces as empirically useful despite not reviewing the code, and thank its creators for the innovative experiment.
Based on 2 visible X reactions from 2 accounts; directional sample.
Ask a question below.
Published answers will appear here.