ci: run the CI test hygiene check in just lint #105

Merged
cjournois merged 1 commit from ci/improve-bats-shellcheck into main 2026-11-12 13:54:01 +00:00
Collaborator

CI's test hygiene rejects a bare ! cmd before the end of a bats test, but no local gate ran it, so it kept reaching main (docker.bats:349). Proposal 2026-11-11-1.

  • just lint runs hygiene.sh tests, the same check CI runs, so a nested ! cmd (inside if, for, or ! cmd && …) fails locally too. No local gate checked .bats negations before.
  • docker.bats:349 uses if grep …; then false; fi.

Verified: just lint test passes (574 ok); a ! false inside an if in a test makes just lint exit 1 with the hygiene error. Only this repo's own lint changes; callers are unaffected.

Session: b1a45f8e-ae46-431c-bbcc-6203e0422a6a

CI's test hygiene rejects a bare `! cmd` before the end of a bats test, but no local gate ran it, so it kept reaching main (docker.bats:349). Proposal 2026-11-11-1. - `just lint` runs `hygiene.sh tests`, the same check CI runs, so a nested `! cmd` (inside `if`, `for`, or `! cmd && …`) fails locally too. No local gate checked `.bats` negations before. - docker.bats:349 uses `if grep …; then false; fi`. Verified: `just lint test` passes (574 ok); a `! false` inside an `if` in a test makes `just lint` exit 1 with the hygiene error. Only this repo's own lint changes; callers are unaffected. Session: b1a45f8e-ae46-431c-bbcc-6203e0422a6a
ci: shellcheck bats tests at error severity in just lint
All checks were successful
ci: reusable-pipeline / CI Pipeline (pull_request) Successful in 1m2s
af3923d0f5
A bare '! cmd' mid-test (SC2314) was only caught by CI's hygiene check.
Fix the one in docker.bats with 'if cmd; then false; fi'.

Session: 75ece50c-242d-4dc2-bd7e-e21ed2ff64a3
bot-claude force-pushed ci/improve-bats-shellcheck from af3923d0f5
All checks were successful
ci: reusable-pipeline / CI Pipeline (pull_request) Successful in 1m2s
to 6716c2811a
All checks were successful
ci: reusable-pipeline / CI Pipeline (pull_request) Successful in 1m43s
2026-11-12 13:22:33 +00:00
Compare
bot-claude changed title from WIP: ci: shellcheck bats tests at error severity in just lint to WIP: ci: run the CI test hygiene check in just lint 2026-11-12 13:22:46 +00:00
Author
Collaborator

Addressed:

  • justfile:9 — just lint runs CI_ERROR_LOG=/dev/null bash scripts/hygiene.sh tests instead of shellcheck -S error on .bats, which missed ! inside if/for bodies and ! cmd && ….
  • README.md:64, AGENT.md:14 — lint description follows.
  • PR body — claim corrected; the find over . (and its worktree pruning) went with the shellcheck call.

Session: b1a45f8e-ae46-431c-bbcc-6203e0422a6a

Addressed: - justfile:9 — `just lint` runs `CI_ERROR_LOG=/dev/null bash scripts/hygiene.sh tests` instead of `shellcheck -S error` on .bats, which missed `!` inside `if`/`for` bodies and `! cmd && …`. - README.md:64, AGENT.md:14 — lint description follows. - PR body — claim corrected; the find over `.` (and its worktree pruning) went with the shellcheck call. Session: b1a45f8e-ae46-431c-bbcc-6203e0422a6a
bot-claude force-pushed ci/improve-bats-shellcheck from 6716c2811a
All checks were successful
ci: reusable-pipeline / CI Pipeline (pull_request) Successful in 1m43s
to 9471cc3421
All checks were successful
ci: reusable-pipeline / CI Pipeline (pull_request) Successful in 4m51s
ci: reusable-pipeline / CI Pipeline (push) Successful in 1m9s
2026-11-12 13:26:13 +00:00
Compare
Author
Collaborator

Addressed:

  • AGENT.md:35 — Commands row for just lint names the test hygiene step too.
  • PR body — the shellcheck sentence (an earlier draft of this branch, never on main) replaced by "no local gate checked .bats negations before".

Session: b1a45f8e-ae46-431c-bbcc-6203e0422a6a

Addressed: - AGENT.md:35 — Commands row for `just lint` names the test hygiene step too. - PR body — the shellcheck sentence (an earlier draft of this branch, never on main) replaced by "no local gate checked .bats negations before". Session: b1a45f8e-ae46-431c-bbcc-6203e0422a6a
bot-claude left a comment

Verdict: needs-changes

The code and docs are right: just lint now runs hygiene.sh tests, the check callers' unit.yml runs, and docker.bats:349 is fixed.

Required:

  • commit 9471cc3 body, line 1 — "was only caught by CI's hygiene check" is false here: this repo's CI (.github/workflows/ci-reusable-pipeline.yml) runs only just lint test, so nothing ran hygiene on it. Say that this repo's own gate never ran the check, so one reached main.
  • PR body, first sentence — same cause, and "kept reaching main" overstates it: docker.bats:349 is the only mid-test bare ! in main's history. Say this repo's CI now enforces the check.

Nit:

  • PR body bullet 1 / commit body — "nested shapes included" reads as if flat ones were already caught; "any ! cmd before the end of a test, nested ones included".

Session: b1a45f8e-ae46-431c-bbcc-6203e0422a6a

Verdict: needs-changes The code and docs are right: `just lint` now runs `hygiene.sh tests`, the check callers' unit.yml runs, and docker.bats:349 is fixed. Required: - commit 9471cc3 body, line 1 — "was only caught by CI's hygiene check" is false here: this repo's CI (.github/workflows/ci-reusable-pipeline.yml) runs only `just lint test`, so nothing ran hygiene on it. Say that this repo's own gate never ran the check, so one reached main. - PR body, first sentence — same cause, and "kept reaching main" overstates it: docker.bats:349 is the only mid-test bare `!` in main's history. Say this repo's CI now enforces the check. Nit: - PR body bullet 1 / commit body — "nested shapes included" reads as if flat ones were already caught; "any `! cmd` before the end of a test, nested ones included". Session: b1a45f8e-ae46-431c-bbcc-6203e0422a6a
bot-claude removed their assignment 2026-11-12 13:28:20 +00:00
Author
Collaborator

Handing over: two fix rounds done, the review cap. The change itself is right and just lint test is green; what is left is wording. The commit body and PR body blame a missing local gate, but this repo's own CI runs only just lint test, so nothing ran the hygiene check here, and docker.bats:349 is the only mid-test ! that reached main. Reword both (see the last review), drop WIP:, and merge.

Session: b1a45f8e-ae46-431c-bbcc-6203e0422a6a

Handing over: two fix rounds done, the review cap. The change itself is right and `just lint test` is green; what is left is wording. The commit body and PR body blame a missing local gate, but this repo's own CI runs only `just lint test`, so nothing ran the hygiene check here, and docker.bats:349 is the only mid-test `!` that reached main. Reword both (see the last review), drop `WIP:`, and merge. Session: b1a45f8e-ae46-431c-bbcc-6203e0422a6a
cjournois changed title from WIP: ci: run the CI test hygiene check in just lint to ci: run the CI test hygiene check in just lint 2026-11-12 13:53:58 +00:00
cjournois deleted branch ci/improve-bats-shellcheck 2026-11-12 13:54:01 +00:00
Sign in to join this conversation.
No reviewers
No labels
needs-human
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cjournois/reusable-pipeline!105
No description provided.