ci: format / lint / test gates + tool pins#264
Closed
watwea-nominal wants to merge 5 commits into
Closed
Conversation
…chain) Adds the per-tool configuration files that pin tool versions and behavior to match the rigor used in a sibling Rust workspace: - rust-toolchain.toml pins the stable channel for cargo invocations - taplo.toml drives deterministic TOML formatting / linting - clippy.toml is staged with the the sibling repo disallowed-methods rule commented out as a TODO; current source contains ~100 unwrap/expect call sites that need a dedicated cleanup PR before that rule can be enforced.
Ports the script-based gates that a sibling Rust workspace uses: - scripts/tooling.sh: pinned tool versions (nightly toolchain, taplo, cargo-machete) and helpers (ensure_*, check_ascii_files) so CI and local runs use the same versions. - scripts/fmt.sh: nightly rustfmt + taplo fmt + non-ASCII char check - scripts/lint.sh: cargo clippy --all-targets --all-features -D warnings + taplo lint + cargo machete (the sibling repo's check-assert-messages step is omitted; it's an sibling-repo-internal crate). - scripts/test.sh: cargo test --all --all-features (with optional --release passthrough).
Replaces the prior single-job rust workflow with a multi-job CI that mirrors a sibling Rust workspace' rigor: - format job: runs scripts/fmt.sh --check - lint job: runs scripts/lint.sh (clippy -D warnings + taplo + machete) - test job: runs scripts/test.sh - build-gate: fan-in that fails if any upstream job failed/skipped Also brings over the composite actions for sccache (setup-rust-cache) and cargo tool caching (cache-cargo-tools). Uses ubuntu-latest runners since depot runners are not configured in this repo. WASM + release- binary jobs from the sibling repo are intentionally omitted; nominal-streaming is a library crate plus python bindings.
Three small follow-on changes required to make the new ci.yml green locally: - taplo fmt reformats top-level TOML files (Cargo.toml, pyproject.toml, release-plz.toml, and the py-nominal-streaming variants). Pure reformat; no semantic change. - cargo-machete flags derive_more (nominal-streaming) and openssl, once_cell, tracing-subscriber (py-nominal-streaming) as unused. These are intentionally retained (vendored link-time deps and crates staged for upcoming work), so they're added to the per-crate package.metadata.cargo-machete.ignored lists. - rust.just gains lint/fmt wrappers and rewires check/fix/test to call the new scripts so `just rust::lint` etc. work locally.
a3005f9 to
ceaf6bb
Compare
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.
Summary
Adds the format / lint / test CI gates that this crate didn't have, modeled on patterns already in use elsewhere in the org.
clippy.toml,taplo.toml,rust-toolchain.toml— pin tool versions and behavior.scripts/{tooling,fmt,lint,test}.sh— local + CI use the same pinned tools..github/workflows/ci.yml— replaces the prior singlebuild-and-test-rust.ymlwith parallelformat/lint/testjobs feeding abuild-gate.rust.justgains wrappers sojust rust::lintmatches CI.Follow-on adjustments to make the new pipeline green
taplo fmtreformatted top-level TOMLs (no semantic change).cargo macheteflaggedderive_more/openssl/once_cell/tracing-subscriberas currently unused; intentionally retained (link-time deps + staged for upcoming work), added to per-cratepackage.metadata.cargo-machete.ignored.Deferred
clippy.tomlincludes a commented-outdisallowed-methodsrule (nounwrap/expecton non-test code). The crate carries ~100 such call sites today; a dedicated cleanup PR will replace those with?error handling and then uncomment the rule.Intentionally not added
Test plan
bash scripts/fmt.sh --checkcleanbash scripts/lint.shcleanbash scripts/test.shclean (15 unit tests + 2 doctests)