fix(husky): stop the pre-commit hook blocking every commit - #6
Merged
Conversation
`bun test` exits 1 when it matches no test files, and this repo has none,
so the pre-commit hook fails on every commit:
error: 0 test files matching **{.test,.spec,_test_,_spec_}.{js,ts,jsx,tsx}
husky - pre-commit script failed (code 1)
Guarded on a test file actually existing. The first one added turns the
step back on by itself, so this does not quietly disable testing.
Committed with --no-verify because the hook being fixed is what rejects
the fix.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DLik2h14rdD7Ks6v5CHRGv
|
Failed to generate code suggestions for PR |
The CI Test job runs the same bare `bun test`, so it fails for the same reason the pre-commit hook did. Same guard, same reasoning: skip only while there is nothing to run. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DLik2h14rdD7Ks6v5CHRGv
GitHub removed the ubuntu-20.04 hosted image, so the Validation job never gets a runner: it sits QUEUED forever behind a check that can neither pass nor fail. Every other job here is already on ubuntu-24.04. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DLik2h14rdD7Ks6v5CHRGv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.husky/pre-commitrunsbun testunconditionally.bun testexits1when it matches no test files, and this repo has none, so every commit is rejected:Guarded on a test file actually existing:
This is not
|| true— a real test failure still blocks the commit. The step is skipped only while the repo has nothing to run, and the first test file added turns it back on by itself.Note
Committed with
--no-verify, because the hook being fixed is exactly what rejects the fix. Nothing else in the commit.🤖 Generated with Claude Code
https://claude.ai/code/session_01DLik2h14rdD7Ks6v5CHRGv