Skip to content

Add ERR trap logging and migrate to [[ ]] in stop-gate.sh - #36

Merged
5uck1ess merged 2 commits into
mainfrom
fix/stop-gate-preexisting-issues
Apr 9, 2026
Merged

Add ERR trap logging and migrate to [[ ]] in stop-gate.sh#36
5uck1ess merged 2 commits into
mainfrom
fix/stop-gate-preexisting-issues

Conversation

@5uck1ess

@5uck1ess 5uck1ess commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • ERR trap logging: The ERR trap in stop-gate.sh silently approved and exited on any crash with no indication anything went wrong. Now logs stop-gate: ERR trap fired — approving to avoid hang to stderr before approving. Users can now see when the quality gate is broken.
  • [ ][[ ]]: Migrated all 17 test brackets from POSIX [ ] to bash [[ ]] per .claude/rules/shell.md. Safer with unquoted variables and glob patterns.

Why

These were flagged as pre-existing issues during the tri-review and pr-review-toolkit review of PR #35, but out of scope for that diff. Cleaning them up separately.

Test plan

  • bash -n hooks/stop-gate.sh — syntax valid
  • grep '^\s+\[ ' hooks/stop-gate.sh — no remaining [ ] brackets
  • No functional changes — same logic, better safety

5uck1ess added 2 commits April 9, 2026 17:07
- ERR trap now logs to stderr before approving, so broken quality gates
  are visible in debug output instead of silently passing.
- All test brackets migrated from [ ] to [[ ]] per shell.md rules.
  Bash-specific [[ ]] is safer with unquoted variables and glob patterns.
Tri-review consensus (3/3 agents): one [ -n "$TS_FILES" ] was not
converted to [[ ]]. Now all brackets in stop-gate.sh use [[ ]].
@5uck1ess
5uck1ess merged commit 30999e8 into main Apr 9, 2026
3 checks passed
@5uck1ess
5uck1ess deleted the fix/stop-gate-preexisting-issues branch April 9, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant