Skip to content

Commit 04ffdbe

Browse files
committed
feat(xtask): [GAP-031] add lines:check 500-line linter and enforce in xtask ci
1 parent ab190ff commit 04ffdbe

13 files changed

Lines changed: 1070 additions & 713 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ Run the same gates CI runs before you open a pull request.
4343

4444
```bash
4545
# Full local CI gate: fmt, then clippy (-D warnings), then deps:check,
46-
# then the crate-DAG cycle check.
46+
# then lines:check, then the crate-DAG cycle check.
4747
cargo xtask ci
4848

4949
# Individual tasks.
5050
cargo xtask fmt # cargo fmt --all -- --check
5151
cargo xtask clippy # cargo clippy --workspace --all-targets -- -D warnings
5252
cargo xtask deps:check # fail on dependency-version drift (see STD-002)
53+
cargo xtask lines:check # fail on any source file over the 500-line limit (ADR-0009)
5354
cargo xtask check-cycles # validate the crate dependency graph stays acyclic
5455
cargo xtask migrate # run the framework's registered migrations
5556

@@ -63,7 +64,8 @@ cargo audit
6364
`cargo xtask` is a convenience alias defined in `.cargo/config.toml`; it expands
6465
to `cargo run -p xtask --`. The task surface is implemented in
6566
`xtask/src/main.rs` (`ci`, `fmt`, `clippy`, `check-cycles`, `deps:check`,
66-
`migrate`, and the `docker:up` / `docker:down` / `docker:logs` helpers).
67+
`lines:check`, `migrate`, and the `docker:up` / `docker:down` / `docker:logs`
68+
helpers).
6769

6870
To format the tree in place rather than check it:
6971

@@ -123,7 +125,7 @@ cargo test -p rustasea --features integration -- --ignored
123125

124126
| Job | What it runs |
125127
|---|---|
126-
| `quality` | `cargo xtask ci` (fmt, clippy with `-D warnings`, `deps:check`, cycle check) |
128+
| `quality` | `cargo xtask ci` (fmt, clippy with `-D warnings`, `deps:check`, `lines:check`, cycle check) |
127129
| `test` | `cargo test --workspace` |
128130
| `deny` | `cargo deny check` |
129131
| `audit` | `cargo audit` |
@@ -138,7 +140,8 @@ cargo test -p rustasea --features integration -- --ignored
138140
generated trees). A file that must exceed the limit needs a documented
139141
exception recorded in an ADR; see `ADR-0009` for the one existing exemption
140142
(`.agents/documents/requirements/fsd.md`). Split a file that grows past the
141-
limit rather than leaving it oversized.
143+
limit rather than leaving it oversized. `cargo xtask lines:check` enforces the
144+
limit for `.rs` sources and runs as part of `cargo xtask ci`.
142145
- **No `unwrap()` or `expect()` in non-test code.** Framework crates are
143146
expected to use typed errors (for example `thiserror`-derived enums) instead
144147
of panicking on fallible calls; `rustasea-auth` carries

0 commit comments

Comments
 (0)