Repository navigation
Adopt rustfmt and check formatting in CI - #17
Merged
Merged
Conversation
Use only settings that stable rustfmt supports: lines up to 110 characters, and use_small_heuristics = "Max" so that a short expression stays on one line whenever it fits. Together they keep the layout close to that of the existing code. Signed-off-by: Jim Schreckengast <schreck@gmail.com>
Run cargo fmt on the crate and on the fuzz target with the settings in rustfmt.toml. Only layout and the order of imports change. Signed-off-by: Jim Schreckengast <schreck@gmail.com>
The Clippy job now runs cargo fmt --check on the crate and the fuzz target before linting, so a pull request that isn't formatted fails a required check. CONTRIBUTING.md names the coding standard: the Rust Style Guide as rustfmt applies it, and Clippy's default lints. The pull request checklist asks for cargo fmt, and GOVERNANCE.md and docs/architecture.md describe the new step. Signed-off-by: Jim Schreckengast <schreck@gmail.com>
schreck61
enabled auto-merge (rebase)
November 11, 2026 14:39
schreck61
added a commit
that referenced
this pull request
Nov 11, 2026
List the formatting commit from #17 in .git-blame-ignore-revs, which GitHub's blame view reads, and say in CONTRIBUTING.md how to make git blame skip it locally. Signed-off-by: Jim Schreckengast <schreck@gmail.com>
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.
What
use_small_heuristics = "Max"keeps a short expression on one line whenever it fits, so the layout stays close to what it was.cargo fmton the crate and the fuzz target, nothing else. It changes 38 of the 45 Rust files (+1,889/−455 lines), mostly by splitting long signatures, calls, conditions and method chains across lines, and it sorts a few imports. The code had no hand-aligned tables, so nothing needed#[rustfmt::skip].cargo fmt --checkon the crate and the fuzz target before linting. Clippy is already a required check, so a pull request that isn't formatted can't merge, and the ruleset stays as it is.cargo fmt --all --checkwith the other checks. The pull request template, GOVERNANCE.md and the CI table in docs/architecture.md mention the new step.Once this merges, a follow-up adds the formatting commit to
.git-blame-ignore-revs, so thatgit blameand GitHub's blame view skip it. It can't be part of this pull request, because a rebase merge gives the commit a new hash.Why
Nothing checked the code's layout, and a contributor who runs
cargo fmtout of habit would have reformatted whole files. This also meets the coding_standards and coding_standards_enforced criteria of the OpenSSF Best Practices silver badge.Testing
cargo fmt --all --checkandcargo fmt --manifest-path fuzz/Cargo.toml --checkare clean. The second also works withoutfuzz/Cargo.lock, which the Clippy job doesn't have.cargo build --locked --release --all-targetsandcargo test --locked --releasepass.cargo clippy --locked --release --all-targets -- -D warningsand its wasm32 counterpart pass.