Repository navigation
ci: check formatting on one toolchain, not the whole matrix - #34
Merged
Merged
Conversation
`cargo fmt --all -- --check` ran for every entry in the matrix, including unpinned `nightly`. rustfmt's output drifts between nightlies, so an unrelated rustfmt change could turn every open PR red with no commit to this repo — which is what happened when a nightly started requiring a block comment's closing delimiter to align with the lines above it. `main` went red on its own, and PRs inherited a failure that had nothing to do with them. Formatting is now checked once, against the toolchain the project pins. That matches how clippy, audit and machete are already restricted to 1.97.1 in this file; the `nightly` and MSRV jobs keep building and testing as before. Note the coupling this creates: bumping the pinned stable in the matrix means updating this guard too, or the check silently stops running. The three steps below have the same property.
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.
cargo fmt --all -- --checkruns for every entry in the build matrix,including unpinned
nightly.rustfmt's output drifts between nightlies, so an unrelated rustfmt change can
turn every open PR red with no commit to this repo. That happened between
nightly 2026-08-14 and 2026-09-23, when rustfmt started requiring a block
comment's closing delimiter to align with the lines above it:
mainwent redon its own, and PRs inherited a failure that had nothing to do with them.
Patching the comment unblocked it, but the next drift does the same thing.
Change
One line — the fmt step is gated to the pinned stable toolchain:
This follows the file's own convention: clippy, audit and machete are already
restricted to
1.97.1. Thenightlyand MSRV jobs keep building and testingexactly as before — only the formatting check stops being run three times
against three different rustfmt versions.
Trade-off worth knowing
Bumping the pinned stable in the matrix now means updating this guard too, or
the check silently stops running. The three steps below it already have that
property, so this does not add a new class of problem, but it is a second
place to remember.
Verification
cargo +1.97.1 fmt --all -- --checkpasses on this branch, and the workflowparses. CI is the real test: the nightly job should no longer run a fmt step
and should still build and test.