Add rustfmt check to sandbox CI - #22369
Conversation
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit e1ec540. 'Diff too large, requires skip by maintainers after manual review' Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Reviewer Guide 🔍(Review updated until commit 38be390)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 38be390 Explore these optional code suggestions:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22369 +/- ##
============================================
- Coverage 73.52% 73.46% -0.07%
+ Complexity 76254 76199 -55
============================================
Files 6076 6076
Lines 345790 345793 +3
Branches 49762 49763 +1
============================================
- Hits 254236 254023 -213
- Misses 71371 71587 +216
Partials 20183 20183 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Persistent review updated to latest commit b2fe0a0 |
|
Persistent review updated to latest commit 1342ab4 |
|
❌ Gradle check result for 1342ab4: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 0223f88 |
|
Persistent review updated to latest commit ec5ba14 |
|
Persistent review updated to latest commit b3fe422 |
Apply `cargo fmt --all` across the sandbox native (Rust) workspace and wire a `cargo fmt --all -- --check` step into the sandbox-check GitHub Action so formatting regressions are caught in CI. Formatting uses rustfmt's default style (100-char width). No rustfmt.toml is added: rustfmt resolves config by walking up from each file's directory, and the workspace pulls in plugin crates from sibling paths (sandbox/plugins/...) that a config under dataformat-native/rust/ would not cover — so a width override there would apply only to the three lib crates and silently leave the plugin crates on the default. Relying on the default keeps every sandbox crate on one consistent style. The rustfmt component is added to the Rust toolchain setup and the format check runs before the build steps so it fails fast. Clippy enforcement will follow in a separate change. Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
|
Persistent review updated to latest commit 38be390 |
|
❕ Gradle check result for 38be390: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
|
@peternied @jed326 @peterzhuamazon folks please review |
Description
Adds Rust formatting enforcement to the sandbox native (Rust) workspace and wires it into CI.
rustfmt.tomlat the workspace root (sandbox/libs/dataformat-native/rust/) pinned tomax_width = 140, matching the OpenSearch Java code style (seeCLAUDE.md). Edition is intentionally left unset so rustfmt honors each crate's ownedition = 2021. Testing showed 140 also produces the least reformatting churn, i.e. it is closest to how the code was already written.cargo fmt --allnormalization across the workspace (186 files). Prior to this the sources had never been run through rustfmt.sandbox-check.yml: adds therustfmtcomponent to the Rust toolchain setup and acargo fmt --all -- --checkstep placed before the protobuf/build steps so it fails fast on formatting regressions.The bulk of the diff is the mechanical
cargo fmtreformat; the meaningful changes arerustfmt.tomland the workflow edit.Clippy enforcement (
cargo clippy -D warnings) is deliberately not in this PR — it requires fixing pre-existing correctness-lint errors and warnings first, and will follow as a separate change.Check List
--signoffBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.