From d6b2c19af1697ea7758b9c0b766bdec6b3b9d59b Mon Sep 17 00:00:00 2001 From: SombraSoft Date: Mon, 23 Nov 2026 19:45:05 -0300 Subject: [PATCH 1/2] CI: run clippy on all targets, warnings only A separate Windows job runs `cargo clippy --workspace --all-targets` on every push and pull request. The tree is not lint-clean (clippy 0.1.100 reports about 630 warnings), so the warnings are listed in the job's log and do not fail it; a failing lint must not block merges. The job runs in parallel with the build and takes about 70 s on a cold cache, so it does not lengthen CI. --- .github/workflows/ci.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc905cb1bc..96e905f478 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,8 @@ # (each prints "SKIPPED : ", counted at the end of scripts/test.ps1) and the # tests on game data pass without running. What it checks on every push and pull request: # the workspace builds, the unit / integration tests pass, and the recompiler's HLSL compiles -# with the runner's DXC (Windows SDK). +# with the runner's DXC (Windows SDK). A second job runs clippy on all targets: its warnings +# are listed in the job's log and do not fail it, because the tree is not lint-clean. # # Left out: the test title's end-to-end run (`test_title_runs_and_game_folder_is_untouched`). # The runner has no System32\xgameruntime.dll (Gaming Services) and only the Microsoft Basic @@ -52,3 +53,28 @@ jobs: - name: Build and test shell: pwsh run: ./scripts/test.ps1 --skip test_title_runs_and_game_folder_is_untouched + + clippy: + name: Clippy (Windows) + runs-on: windows-2025 + timeout-minutes: 30 + env: + CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: 0 + steps: + - uses: actions/checkout@v4 + + - name: Rust (stable, MSVC, clippy) + run: | + rustup toolchain install stable --profile minimal + rustup default stable + rustup component add clippy + rustc --version + cargo clippy --version + + - uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} + + - name: Clippy + run: cargo clippy --workspace --all-targets From 86790b276533235ba07f2ebc3f4992704851e2f7 Mon Sep 17 00:00:00 2001 From: SombraSoft Date: Mon, 23 Nov 2026 19:53:33 -0300 Subject: [PATCH 2/2] Docs: AGENTS.md asks agents to run clippy on the code they change CI's clippy job only warns, so nothing stops a PR that adds new warnings. AGENTS.md now lists the clippy command next to the build and test commands and asks agents to fix the warnings in the lines they write or change, and to leave the existing ones alone (Scope: no drive-by fixes). --- AGENTS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 88ef1e71b0..527b1029b1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -23,12 +23,16 @@ Windows 10/11 x64 only, `stable-x86_64-pc-windows-msvc`, Windows SDK (DXC), a D3 .\scripts\test.ps1 # build + all tests cargo build --workspace && cargo test --workspace -- --test-threads=4 # same, from bash / in the background cargo test -p xcl --lib # one area while iterating +cargo clippy --workspace --all-targets # lints, as the CI clippy job runs them ``` - GPU tests print `SKIPPED : ` when the adapter cannot run them and still pass. Report skips; do not count them as coverage. - On macOS / Linux the crate does not build or run. Do not claim it does: say "not built / not tested" in the PR. +- Run clippy before you commit and fix the warnings it reports **in the lines you wrote or + changed**. The tree is not lint-clean and CI's clippy job only warns, so it will not stop you: the + check is yours. Leave the warnings in code you did not touch (no drive-by fixes, see Scope). - Editing files through PowerShell `Get-Content` / `Set-Content` corrupts UTF-8: use your file tools. - Some steps (DXC compiles of many shaders, whole-pack runs) take many minutes: run them on small samples first.