chore(dx): enforce clippy and rustfmt in CI - #45
Open
duyet wants to merge 1 commit into
Open
Conversation
CI now fails on `cargo fmt --check` and `cargo clippy --locked --all-targets -- -D warnings`. The live baseline is fixed so the gate is green. `&PathBuf` params become `&Path`, `catalog_lookup_enabled` uses `matches!`, `term` uses `div_ceil`, `persist_channel` uses `unwrap_or_default`, `ToolConfig` derives Default, and the help thread_local initializer is const. The JS-mirrored test helper `getKeyPrefixStyleMask` keeps its name behind `#[allow(non_snake_case)]`. Closes #22 Co-authored-by: Duyet Le <me@duyet.net> Co-authored-by: duyetbot <bot@duyet.net>
Contributor
anyr size and startupStartup is wall time for a cold Size budget:
Budget check: ok raw timings[
{
"asset": "anyr-darwin-arm64",
"kind": "native",
"path": "/Users/runner/work/cli/cli/anyr-darwin-arm64",
"bytes": 2921688,
"size": "2.8 MiB",
"version": "0.1.11 (built 2026-09-03 18:03:41)",
"target": "aarch64-apple-darwin",
"os": "macos-latest",
"startup_version": {
"n": 21,
"min_ms": 3.23,
"median_ms": 4.51,
"p95_ms": 7.26,
"mean_ms": 4.94
},
"startup_help": {
"n": 21,
"min_ms": 2.98,
"median_ms": 4.27,
"p95_ms": 6.56,
"mean_ms": 4.49
}
},
{
"asset": "anyr-darwin-x86_64",
"kind": "native",
"path": "/Users/runner/work/cli/cli/anyr-darwin-x86_64",
"bytes": 3119528,
"size": "3.0 MiB",
"version": "0.1.11 (built 2026-09-03 18:03:43)",
"target": "x86_64-apple-darwin",
"os": "macos-latest",
"startup_version": {
"n": 21,
"min_ms": 33.35,
"median_ms": 37.14,
"p95_ms": 41.3,
"mean_ms": 37.91
},
"startup_help": {
"n": 21,
"min_ms": 34.91,
"median_ms": 38.74,
"p95_ms": 42.54,
"mean_ms": 38.53
}
},
{
"asset": "anyr-linux-arm64",
"kind": "native",
"path": "/home/runner/work/cli/cli/anyr-linux-arm64",
"bytes": 2888744,
"size": "2.8 MiB",
"version": "0.1.11 (built 2026-09-03 18:02:59)",
"target": "aarch64-unknown-linux-gnu",
"os": "ubuntu-24.04-arm",
"startup_version": {
"n": 21,
"min_ms": 0.69,
"median_ms": 0.71,
"p95_ms": 0.79,
"mean_ms": 0.73
},
"startup_help": {
"n": 21,
"min_ms": 0.67,
"median_ms": 0.72,
"p95_ms": 0.75,
"mean_ms": 0.71
}
},
{
"asset": "anyr-linux-x86_64",
"kind": "native",
"path": "/home/runner/work/cli/cli/anyr-linux-x86_64",
"bytes": 3216552,
"size": "3.1 MiB",
"version": "0.1.11 (built 2026-09-03 18:03:02)",
"target": "x86_64-unknown-linux-gnu",
"os": "ubuntu-latest",
"startup_version": {
"n": 21,
"min_ms": 0.6,
"median_ms": 0.65,
"p95_ms": 0.72,
"mean_ms": 0.66
},
"startup_help": {
"n": 21,
"min_ms": 0.61,
"median_ms": 0.63,
"p95_ms": 0.75,
"mean_ms": 0.64
}
},
{
"asset": "anyr-windows-x86_64.exe",
"kind": "native",
"path": "D:\\a\\cli\\cli\\anyr-windows-x86_64.exe",
"bytes": 2665984,
"size": "2.5 MiB",
"version": "0.1.11 (built 2026-09-03T18:04:36Z)",
"target": "x86_64-pc-windows-msvc",
"os": "windows-latest",
"startup_version": {
"n": 21,
"min_ms": 9.07,
"median_ms": 9.29,
"p95_ms": 9.59,
"mean_ms": 9.32
},
"startup_help": {
"n": 21,
"min_ms": 9.01,
"median_ms": 9.22,
"p95_ms": 9.43,
"mean_ms": 9.21
}
},
{
"asset": "anyr.wasm",
"kind": "wasm",
"path": "/home/runner/work/cli/cli/target/wasm-pkg/anyr_cli_bg.wasm",
"bytes": 180519,
"size": "176.3 KiB",
"version": "wasm",
"target": "wasm32-unknown-unknown",
"os": ""
}
] |
2 tasks
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.
Closes #22 (Plan 007).
Why
CI ran
cargo fmt --checkwithcontinue-on-errorand never ran clippy. Formatting drifted and the 13-plus style warnings hid real ones. The test job now fails the PR when fmt or clippy is dirty.Scope
.github/workflows/ci.ymllint job installs clippy, runscargo fmt --checkwithoutcontinue-on-error, and runscargo clippy --locked --all-targets -- -D warningsbefore llvm-cov.main(line numbers in the issue are stale).src/commands.rs&PathBufparams become&Path.catalog_lookup_enabledusesmatches!.src/help.rsthread_local initializer isconst { RefCell::new(String::new()) }.src/spawn.rsToolConfigderivesDefault. Test usescontains_key.src/term.rsusesdiv_ceil.src/tui/view.rsdrops a uselessformat!.src/upgrade.rsusesunwrap_or_default.src/http.rstest helpergetKeyPrefixStyleMaskkeeps the JS-mirrored name behind#[allow(non_snake_case)]. That warning is new since the plan was written. Without the allow,-D warningscannot pass.Out of scope: pedantic clippy groups, wasm clippy, behavior changes.
Tradeoffs
The allow on
getKeyPrefixStyleMaskkeeps the helper name aligned with the server'sgetKeyPrefix()instead of renaming a test-only JS mirror.Blast radius
Every PR now fails on new clippy warnings and unformatted Rust. Contributors need
cargo fmtandcargo clippy --locked --all-targets -- -D warningslocally. Existing tests are unchanged.Verification
cargo clippy --locked --all-targets -- -D warnings— exit 0cargo fmt --check— exit 0cargo test --locked --all-targets— 186 lib + 68 cli + 7 release_lock passedci.yml— exit 0grepshows clippy-D warningsand nocontinue-on-erroron fmtChecklist