build.sh: run cargo fmt --check and cargo clippy after build#299
Merged
Conversation
Matches what build.bat already does on Windows (lines 62-64). CI runs the same two commands as a gate on every PR, so catching violations locally before pushing keeps the round-trip short. Cost is negligible after the first build: ~1s warm, ~2s incremental. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
shschaefer
approved these changes
May 12, 2026
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.
📖 Description
Brings
build.sh(Linux) to parity withbuild.bat(Windows), which already runscargo fmt --all -- --checkandcargo clippy --workspace --all-targets -- -D warningsafter the Rust build (build.bat:62-64).CI runs the same two commands as a gate on every PR. Running them locally before pushing avoids a 3-minute round-trip when something trivial (formatting, an easy lint) trips the gate.
Cost in the developer loop: negligible after the first build. On a typical Windows-on-ARM workstation:
cargo clean)The cold cost is paid once; subsequent runs share clippy's incremental compilation cache with
cargo build.🔗 References
Motivated by hitting
clippy::field_reassign_with_defaultin CI on #291 after only runningcargo build/cargo testlocally —build.batwould have caught it before pushing,build.shwould not have.🔍 Validation
build.batlines 62-64.build.shkeepsset -euo pipefail, so non-zero exit from either command halts the script before the SDK build step.--debug,--rust-only,--with-hyperlightbehavior is preserved (both lint commands always run regardless).Microsoft Reviewers: Open in CodeFlow