Repository navigation
Unused code: cargo-shear and Knip in CI (sc-9611) - #269
Open
ndbroadbent wants to merge 2 commits into
Open
ndbroadbent wants to merge 2 commits into
ndbroadbent wants to merge 2 commits into
Conversation
ndbroadbent
force-pushed
the
ci-squawk
branch
from
December 5, 2026 06:05
2212652 to
cdfc88f
Compare
ndbroadbent
force-pushed
the
ci-unused
branch
from
December 5, 2026 06:05
1349af3 to
4e3568e
Compare
… frontend in CI; snapshot-diff out of app, axum a Loco dev-dependency, the stale ts-rs bindings deleted (sc-9611)
…token, Knip's entry is just site.mjs so an unused script fails, the empty seeders module is ignored by cargo-shear, and AGENTS.md says its file warnings don't fail
ndbroadbent
force-pushed
the
ci-unused
branch
from
December 5, 2026 06:10
fde20b6 to
77ae12c
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Twelfth PR for sc-9611: unused code. It's stacked on #268. Talira had Knip for the JavaScript side and nothing for Rust. I chose cargo-shear over cargo-machete: it parses the code rather than grepping it, and it also catches misplaced and dev-only dependencies.
cargo-shear 1.14.1 (pinned in mise.toml) runs in CI's
lintjob on all three Rust workspaces. Fixed in this PR:snapshot-diffcame out ofapp/Cargo.toml: nothing in app/ uses it. Cargo.lock loses one line. It isn't in the renderer's inputs, and no CLI crate changes.axummoved to[dev-dependencies]: only its tests use it.app's migrations are compiled in bylaravel::db::migrations!, not bymod, so they're listed asignored-pathsin[package.metadata.cargo-shear].Knip 6.49.0 runs on
frontend/in theclientsjob, after the frontend's install (knip.jsonc).pnpm dlxat a pinned version rather than as a devDependency, which would add 550 lines to the frontend lockfile other branches edit.src/bindings/(two files generated by ts-rs, which no crate uses any more).@fontsource/geist, whichscripts/og.mjsloads withrequire.resolveon a computed path.Not yet: Knip on the gallery workspace and the scripts packages. Their examples and tests need entry config first, which is the gallery session's area, so it's a follow-up.
It starts green: cargo-shear exits 0 on all three workspaces (one warning: the empty
database/seeders/mod.rs), and Knip exits 0. actionlint, the suppressions check and the file-length check are clean.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.