xtask: add qa command to run policy, rustfmt, and clippy checks #545
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!545
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-545"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@pushkarreddyy on GitHub · 2026-11-24 04:43 UTC · original
pushkarreddyy:feat/xtask-qa-command→main· +69 −1 · 1 files · 2 commits · openMotivation
Currently, contributors and CI systems have to run separate ad-hoc commands to verify repository requirements (
cargo xtask policy,cargo fmt,cargo clippy). There is no unified quality assurance command inxtaskto run all repository quality gates in sequence.Solution
Cmd::Qa { fix: bool }toxtask:Rule #1) viapolicy::run(root, false).cargo fmt --all -- --check(or automatically formats if--fixis passed).cargo clippy --workspace --all-targets).cargo xtask qa/cargo xtask qa --fix) to ensure their branch is ready for submission.No game files used.
@pushkarreddyy on GitHub · 2026-11-24 04:51 UTC · original
### Technical Verification & Implementation Details
Context & Architecture
Contributors and CI systems previously had to invoke disparate commands to verify repository requirements (
cargo xtask policy,cargo fmt,cargo clippy). Adding a unifiedqasubcommand inxtaskallows contributors to run all repository quality gates in sequence locally before submitting a PR.Changes & Implementation
Cmd::Qa { fix: bool }toxtask/src/main.rs:policy::run(root, false).cargo fmt --all -- --check(or auto-formats with--fix).cargo clippy --workspace --all-targets).cargo xtask qaandcargo xtask qa --fix.Git Log Line & Verification
ext bdb014d xtask: add qa command to run policy, rustfmt, and clippy checks xtask/src/main.rs | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-)cargo xtask policy(Rule #1 compliance, zero game assets).rustfmt --edition 2024.@pushkarreddyy on GitHub · 2026-11-24 06:24 UTC · original
### Call for Maintainer Review & Merge
Infrastructure and quality assurance improvement:
@Marvisak: Ready for review and merge when convenient!
@pushkarreddyy on GitHub · 2026-11-24 11:23 UTC · original
Thanks @mercuryVM for the practical feedback on workspace formatting dynamics!
You're completely right: running
cargo fmt --allacross the whole tree causedqato fail on main's preexisting 168 unformatted hunks, and--fixwould pull unrelated formatting changes into contributors' PRs.I've updated
xtask/src/main.rsin commit366f485so that step 2:origin/main...HEAD/ working tree.rustfmt --edition 2024only on the modified files (with--checkon check, or formatting them on--fix).This ensures contributors can run
cargo xtask qa/cargo xtask qa --fixcleanly on their PR without touching or failing on unrelated files.@pushkarreddyy on GitHub · 2026-11-24 12:38 UTC · original
Thank you @mercuryVM for testing and approving!
Acknowledged on the edition nit: reading the edition dynamically from
rustfmt.tomlor workspaceCargo.tomlis indeed a cleaner pattern to prevent edition bump drift. I'll include that refinement in future tooling updates.@pushkarreddyy on GitHub · 2026-11-24 12:56 UTC · original
Thank you @catminou4 for testing and approving!
Much appreciated for verifying clean test-merge with main (
ffe310e) and passingcargo test -p xtask --lockedon macOS arm64.Regarding the nit on unit test coverage for the
run_qagit-diff fallback chain: completely agreed. Pinning the fallback logic (origin/main...HEAD->HEAD-> working tree) with mock git rev-parse/diff fixtures will make a great follow-up test improvement once this core command lands.Now with approvals from both @mercuryVM and @catminou4, PR #545 is clean, verified cross-platform, and ready for @Marvisak to merge!
@Marvisak on GitHub · 2026-11-25 01:23 UTC · original · edited 2026-11-25 02:31 UTC
Automated triage for the maintainers.
Needs work. This needs the maintainer's decision: the new
cargo xtask qa(run_qaandchanged_rust_filesinxtask/src/main.rs) startsgit,rustfmtandcargoas child processes.The new head
f13d04ehas the same code as the head reviewed before, so the earlier points still apply:.github/workflows/ci.ymlruns Clippy with--locked -- -D warnings, once by default and once with--all-features.run_qaruns plaincargo clippy --workspace --all-targets, so warnings don't fail it and the all-features configuration is never checked.qacan pass a branch that CI rejects.changed_rust_filesstops at the firstgit diffthat lists any files. Once the branch has commits againstorigin/main, uncommitted edits are never checked. It also depends on a localorigin/mainref.--edition 2024rather than taken from the workspace.If the maintainer wants the command, matching the two CI Clippy invocations exactly would fix the main gap.
CI: passing.
Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.