Skip to content

Commit d7040b4

Browse files
ci: run anti-slop lint in CI and pre-push (CMP-84) (#153)
Co-authored-by: grim <75869731+ripgrim@users.noreply.github.com>
1 parent 652135b commit d7040b4

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

.githooks/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fail() {
2121
exit 1
2222
}
2323

24-
for task in check-types lint test; do
24+
for task in check-types lint lint:slop test; do
2525
echo "pre-push: bun run $task"
2626
bun run "$task" || fail "$task"
2727
done

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,6 @@ jobs:
6464

6565
- run: bun run lint
6666

67+
- run: bun run lint:slop
68+
6769
- run: bun run test

CONTRIBUTING.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,20 @@ bun run dev
3636
```sh
3737
bun run check-types
3838
bun run lint
39+
bun run lint:slop
3940
bun run test
4041
```
4142

42-
All three run on CI, and `bun run format` fixes most of what `lint` complains about.
43+
All four run on CI, and `bun run format` fixes most of what `lint` complains about.
44+
45+
`lint:slop` is [anti-slop](https://github.com/dmmulroy/anti-slop) over Oxlint, and it holds one
46+
line: **data crossing an I/O boundary is parsed into a domain type at the point it arrives.** No
47+
`Record<string, unknown>` standing in for a contract, no `typeof` check standing in for a parser,
48+
no `unknown` parameter without a schema, no `as unknown as` around a `Json` column. Shapes that
49+
cross a package boundary live in `packages/validation/src`, one module per shape. It was taken to
50+
zero in one pass; the gate is what keeps it there. A genuinely open map — a telemetry property
51+
bag, a log field, a user-defined custom field value — is scoped off in `.oxlintrc.json` with its
52+
reason, and that is the only sanctioned way past it.
4353

4454
**A `pre-push` hook runs them for you**, so a push that would fail CI fails on your machine
4555
instead, where the feedback is in seconds rather than minutes. `bun install` wires it up — the
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "type": "module" }

0 commit comments

Comments
 (0)