Skip to content

Commit 95f00a0

Browse files
authored
remove CI workflow (added to shared repo instead) (#1)
1 parent 4d92de2 commit 95f00a0

3 files changed

Lines changed: 20 additions & 93 deletions

File tree

.github/workflows/dylint.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

CLAUDE.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ must be installed to build.
1818
## CI
1919

2020
- `.github/workflows/ci.yml` - builds and tests the lint crates themselves.
21-
- `.github/workflows/dylint.yml` - reusable workflow that consumer repos call.
22-
It installs the toolchain, builds the lints, and runs them against the caller's
23-
workspace. Lint warnings are denied (fail the build).
21+
- Consumer repos get linting automatically via the `dylint` job in
22+
`init4tech/actions` `rust-base.yml`. That workflow checks out this repo,
23+
builds the lint libraries, and runs them via `DYLINT_LIBRARY_PATH`.
24+
- Repos opt out by adding `[workspace.metadata.dylint] skip = true` to their
25+
`Cargo.toml`.
2426

2527
## Adding a new lint
2628

@@ -32,7 +34,8 @@ must be installed to build.
3234
4. Add a UI test under `ui/` and run `cargo test` to generate the `.stderr` file
3335
(copy it from the path shown in the test failure output).
3436
5. Add the new crate to `.github/workflows/ci.yml`.
35-
6. Add the new lint name to the `RUSTFLAGS` deny list in `.github/workflows/dylint.yml`.
37+
6. Add the new lint name to the `RUSTFLAGS` deny list and a `DYLINT_LIBRARY_PATH`
38+
entry in the `dylint` job in `init4tech/actions` `rust-base.yml`.
3639
7. Update `CLAUDE.md` and `README.md` to document the new lint.
3740

3841
## Modifying a lint

README.md

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,57 +21,31 @@ Three cases are flagged:
2121
Fields that are assigned (`x = expr`), format-hinted (`%x`, `?x`), or recorded
2222
via `.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
6744
rustup toolchain install nightly-2026-03-17 --component rustc-dev --component llvm-tools-preview
6845
cargo 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

Comments
 (0)