Skip to content

linting agent: require standard Husky hook header and executable hook#19

Merged
markcallen merged 3 commits intomainfrom
fix/husky-hook-header
Feb 10, 2026
Merged

linting agent: require standard Husky hook header and executable hook#19
markcallen merged 3 commits intomainfrom
fix/husky-hook-header

Conversation

@markcallen
Copy link
Contributor

Summary

Updates the linting agent so Husky setup follows the standard hook format and works reliably across environments.

Changes

  • Section 5 (Set Up Git Hooks with Husky): Require the standard Husky header (shebang #!/usr/bin/env sh and bootstrap . "$(dirname -- "$0")/_/husky.sh") and that the pre-commit hook file is executable.
  • Implementation order: Step 9 now explicitly says to create the pre-commit hook with the standard Husky header and make it executable.
  • Key Configuration Details: Added a Husky pre-commit hook pattern showing the exact header and npx lint-staged, plus a note to run chmod +x .husky/pre-commit.
  • Important Notes: New bullet stating that the pre-commit hook must use the standard Husky header and be executable; otherwise prepare may succeed but the hook may not run on some setups (e.g. when core.hooksPath is set).

This addresses the feedback that hooks should include the standard Husky header and be executable so they run reliably.

- Add shebang and husky.sh bootstrap to pre-commit hook instructions
- Document chmod +x for .husky/pre-commit so hooks run on all setups
- Add Husky pre-commit pattern to Key Configuration Details
- Clarify in Important Notes that prepare may succeed but hook may fail without header

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings February 10, 2026 00:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the linting agent guidance so Husky hooks are created using the standard, portable hook header and are executable, improving cross-environment reliability.

Changes:

  • Require the standard Husky hook header (shebang + husky.sh bootstrap) and an executable pre-commit hook.
  • Clarify implementation order to explicitly create the standard pre-commit hook and chmod +x it.
  • Add a ready-to-copy pre-commit hook example and expand “Important Notes” accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

markcallen and others added 2 commits February 10, 2026 13:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@markcallen markcallen merged commit 139a2c9 into main Feb 10, 2026
5 of 10 checks passed
@markcallen markcallen deleted the fix/husky-hook-header branch February 10, 2026 00:50
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