ci: add dylint try_io_result check

This commit is contained in:
Bryan Helmkamp 2026-05-02 10:51:03 -04:00
parent de10825ce1
commit 09e924b70d
No known key found for this signature in database
3 changed files with 25 additions and 0 deletions

View file

@ -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

View file

@ -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.

View file

@ -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