@@ -21,57 +21,31 @@ Three cases are flagged:
2121Fields that are assigned (` x = expr ` ), format-hinted (` %x ` , ` ?x ` ), or recorded
2222via ` .record("x", ...) ` in the function body are not flagged.
2323
24- ## Integrating into a repo
24+ ## CI integration
2525
26- ### 1. Add workspace metadata
26+ All repos using
27+ [ ` init4tech/actions ` ] ( https://github.com/init4tech/actions ) ` rust-base.yml `
28+ (or its ` rust-library-base ` / ` rust-bin-base ` wrappers) get these lints
29+ automatically. The ` dylint ` job checks out this repo, builds the lint
30+ libraries, and runs them via ` DYLINT_LIBRARY_PATH ` .
2731
28- In the consumer repo's ` Cargo.toml ` :
32+ ### Opting out
33+
34+ Add the following to the repo's ` Cargo.toml ` :
2935
3036``` toml
3137[workspace .metadata .dylint ]
32- libraries = [
33- { git = " https://github.com/init4tech/lints" , pattern = " instrument-fields" }
34- ]
38+ skip = true
3539```
3640
37- ### 2. Add the CI workflow
38-
39- In ` .github/workflows/dylint.yml ` :
40-
41- ``` yaml
42- name : dylint
43-
44- on :
45- push :
46- branches : [main]
47- pull_request :
48-
49- jobs :
50- dylint :
51- uses : init4tech/lints/.github/workflows/dylint.yml@main
52- ` ` `
53-
54- To check specific packages only:
55-
56- ` ` ` yaml
57- jobs :
58- dylint :
59- uses : init4tech/lints/.github/workflows/dylint.yml@main
60- with :
61- packages : " my-crate other-crate"
62- ` ` `
63-
64- ### Running locally
41+ ## Running locally
6542
6643``` sh
6744rustup toolchain install nightly-2026-03-17 --component rustc-dev --component llvm-tools-preview
6845cargo install cargo-dylint@5.0.0 dylint-link@5.0.0
6946
70- # If using workspace metadata:
71- cargo +nightly-2026-03-17 dylint --all --workspace
72-
73- # Or with a local checkout of the lints repo:
74- DYLINT_LIBRARY_PATH=<PATH TO REPO>/instrument-fields/target/debug \
47+ # Run in the repo to test:
48+ DYLINT_LIBRARY_PATH=< PATH TO LINTS REPO> /instrument-fields/target/debug \
7549 cargo +nightly-2026-03-17 dylint --all --no-deps --workspace
7650```
7751
0 commit comments