From 8522d328a32a1eb5ad15298538c598a179f68152 Mon Sep 17 00:00:00 2001 From: "google-labs-stitch[bot]" <315546542+google-labs-stitch[bot]@users.noreply.github.com> Date: Wed, 25 Nov 2026 04:19:27 +0000 Subject: [PATCH] build: deny warnings in .cargo/config.toml and CI - Add .cargo/config.toml to set -D warnings for rustc and rustdoc - Set RUSTFLAGS="-D warnings" on cargo build in ci.yml - Add .cargo/config.toml to the repository map in AGENTS.md - Document shell RUSTFLAGS and RUSTDOCFLAGS overrides in AGENTS.md --- .cargo/config.toml | 3 +++ .github/workflows/ci.yml | 2 ++ AGENTS.md | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..2779ea3 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,3 @@ +[build] +rustflags = ["-D", "warnings"] +rustdocflags = ["-D", "warnings"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2562d00..bd74493 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,8 @@ jobs: - run: cargo fmt --check - run: cargo clippy --locked --lib -- -D warnings - run: cargo build --locked --release + env: + RUSTFLAGS: "-D warnings" - run: cargo doc --locked --no-deps env: RUSTDOCFLAGS: "-D warnings" diff --git a/AGENTS.md b/AGENTS.md index 4bc6d47..42b4bff 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -87,6 +87,8 @@ this file, rustdoc, code comments, TypeScript comments and commit messages. - `src/wasm.rs`: the wasm-bindgen and tsify bindings (`wasm` feature). - `src/index.ts`: the `loadTunelet` entry point. See also `package.json` and `tsconfig.json`. +- `.cargo/config.toml`: the Cargo flags (`-D warnings`) for `rustc` and + `rustdoc`. ## Build and verify @@ -114,7 +116,10 @@ npm run verify:pack - `.github/workflows/ci.yml` runs these checks on each pull request and each push to `main`. - Make sure that there are no new warnings. This includes broken - rustdoc links. + rustdoc links. `.cargo/config.toml` sets `-D warnings` for `rustc` + and `rustdoc`. A shell `RUSTFLAGS` or `RUSTDOCFLAGS` variable + replaces the flags in `.cargo/config.toml` for that tool. If you set + `RUSTFLAGS` or `RUSTDOCFLAGS` in the shell, include `-D warnings`. - The crate has no tests (`test = false`). Do not add tests or test support if the task does not tell you to. - To verify a DSP change, render PCM from a fixed input and seed before