diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 80cca83b3..7f70e36bc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -74,6 +74,25 @@ jobs: cache-on-failure: true - run: cargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D warnings + dylint: + name: Dylint + runs-on: ubuntu-24.04-x86-32-cores + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable + with: + toolchain: nightly-2025-09-18 + components: rustc-dev,llvm-tools-preview + - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 + with: + cache-on-failure: true + - run: cargo install cargo-dylint dylint-link --version 5.0.0 + - run: cargo dylint --all --workspace -- --all-targets + generated-docs: name: Generated Docs runs-on: ubuntu-24.04-x86-32-cores diff --git a/AGENTS.md b/AGENTS.md index f3ec8b801..c14a401d0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,6 +14,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co - `cargo +nightly-2026-04-14 fmt --check --all` — check formatting (pinned nightly required for rustfmt config; CI uses the same date) - `cargo +nightly-2026-04-14 fmt --all` — auto-format - `cargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D warnings` — lint (CI runs nightly clippy to match; install with `rustup toolchain install nightly-2026-04-14 --profile minimal --component clippy,rustfmt`) +- `cargo dylint --all --workspace -- --all-targets` — run configured Dylint libraries (`try_io_result`); install with `rustup toolchain install nightly-2025-09-18 --profile minimal --component rustc-dev,llvm-tools-preview && cargo install cargo-dylint dylint-link --version 5.0.0` macOS note: if `cargo nextest run` fails with `Too many open files (os error 24)` / `EMFILE`, raise the shell's soft FD limit before running tests, for example `ulimit -n 4096 && cargo nextest run --workspace`. Some terminals and inherited agent sessions start with `ulimit -n 256`, which is too low for the shared CLI test daemon under parallel nextest load. diff --git a/Cargo.toml b/Cargo.toml index 9a3a113f4..7ee856fe3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -126,6 +126,11 @@ use_self = "warn" wildcard_imports = "warn" absolute_paths = "warn" +[workspace.metadata.dylint] +libraries = [ + { git = "https://github.com/trailofbits/dylint", tag = "v5.0.0", pattern = "examples/restriction/try_io_result" }, +] + [profile.release] lto = "thin" strip = true