Sd rust tooling#7
Open
federico-martinez-invgate wants to merge 2 commits into
Open
Conversation
Formatting previously followed rustfmt's floating default style, which changed between toolchain releases (notably import ordering under the 2024 style) and would silently break `cargo fmt --check` in CI as the pinned `stable` channel advanced. Pin it explicitly in rustfmt.toml so formatting is deterministic regardless of the installed rustfmt version, and reformat every file to that style in one pass. This pass also carries the mechanical clippy cleanups that `cargo clippy --fix` applies at the new lint level enabled in the following commit (let-else, map_or, usize::midpoint, clone_from, iterator idioms, inlined format args) plus a WriteLock `_file` -> `file` rename now that the field is read in Drop. No behavioral change; 212 tests pass, byte-identity preserved.
Two additions to raise the quality bar, both wired into the existing CI gates. Lints ([workspace.lints], inherited by both crates): enable clippy::pedantic as a baseline plus rustc unsafe_op_in_unsafe_fn=deny (matters for the FFI/mmap/ GlobalAlloc unsafe) and unreachable_pub. The pedantic lints that are pure noise on a hand-rolled binary-format parser (intentional narrowing casts, exact-float test asserts, lowercase-only file-extension compares, doc-prose nags) are allow-listed with a documented rationale rather than churned away. CI already runs `cargo clippy --all-targets -- -D warnings`, so this is a hard gate. jscpd: copy-paste detector as a regression ratchet. Threshold 7% in .jscpd.json sits above the current ~4.9% (which is mostly intentional: the #[cfg(test)] differential-oracle encoder and repetitive FFI wrappers), so it does not force refactoring today but fails CI on a large new duplicate. Runs in the lint job (node is preinstalled on the runner).
Contributor
Code Metrics Report
Details | | main (6f5ff72) | #7 (028efe6) | +/- |
|---------------------|----------------|--------------|-------|
+ | Coverage | 97.0% | 97.0% | +0.0% |
| Files | 36 | 36 | 0 |
| Lines | 6200 | 6203 | +3 |
+ | Covered | 6017 | 6020 | +3 |
- | Test Execution Time | 6s | 7s | +1s |Code coverage of files in pull request scope (97.2% → 97.2%)Reported by octocov |
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.
No description provided.