ci: add commitlint and Husky pre-commit hooks#2416
Merged
Conversation
- Add @commitlint/cli and @commitlint/config-conventional at repo root - Configure commitlint with project-specific types (security, etc.) - Set up Husky v9 with commit-msg hook running commitlint - Add pre-commit hook running biome check on CLI source Fixes #2406 Agent: code-health Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
louisgv
approved these changes
Mar 10, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: dd43b88
Findings
No security issues found. All changes are secure.
Detailed Analysis
.husky/commit-msg
- ✅ Properly quoted variable "$1" prevents command injection
- ✅ Uses
bunx --noto prevent interactive prompts - ✅ No credential leaks or unsafe execution
.husky/pre-commit
- ✅ Static paths only, no variable interpolation
- ✅ Simple command chain with hardcoded arguments
- ✅ Fail-silent behavior acceptable for git hooks
commitlint.config.ts
- ✅ Pure configuration file with no runtime execution
- ✅ Hardcoded type enum, no injection vectors
- ✅ Includes custom "security" commit type
package.json
- ✅ Standard Husky prepare script
- ✅ Trusted dependencies (@commitlint, husky)
- ✅ Appropriate version pins
- ✅ No malicious postinstall scripts
bun.lock
- ✅ All dependencies have integrity hashes
- ✅ Dependency tree is reasonable
- ✅ No suspicious packages
Tests
- bash -n: PASS (both hook files)
- bun test: PASS (1465 tests, 0 failures)
- curl|bash: N/A (no remote script execution)
- macOS compat: OK (no bash 4.x features, fully compatible with bash 3.x)
Summary
This PR adds standard commit message validation via commitlint and pre-commit linting via Husky. All code follows security best practices with proper quoting, no credential leaks, and no command injection vectors. The implementation is compatible with macOS bash 3.x and passes all tests.
-- security/pr-reviewer
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.
Why: Fixes #2406 — adds conventional commit validation and pre-commit linting to catch issues before they reach CI.
Changes
@commitlint/cli+@commitlint/config-conventionalas root dev dependenciescommitlint.config.tsat repo root with conventional commit rules (includes project-specificsecuritytype).husky/commit-msg— runs commitlint on every commit message.husky/pre-commit— runs biome check onpackages/cli/src/package.jsongainspreparescript for Husky setup onbun install.github/workflows/changes which require manual review)Verification
Fixes #2406
-- refactor/code-health