Skip to content

Detect external hook managers and warn during enable#373

Merged
squishykid merged 6 commits intomainfrom
feat/detect-hook-managers
Feb 17, 2026
Merged

Detect external hook managers and warn during enable#373
squishykid merged 6 commits intomainfrom
feat/detect-hook-managers

Conversation

@squishykid
Copy link
Member

@squishykid squishykid commented Feb 17, 2026

Summary

  • Detect Husky, Lefthook, pre-commit, and Overcommit during entire enable via filesystem checks (no file reads)
  • Husky users get copy-paste instructions for durable hook integration (since Husky overwrites hooks on npm install)
  • Other hook managers get a note to re-run entire enable if hooks are overwritten
  • Lefthook detection covers all 16 valid config filenames ({.,}lefthook{,-local}.{yml,yaml,json,toml})

Test plan

  • mise run fmt && mise run lint && mise run test:ci passes
  • 17 unit tests covering all managers, dedup, warning output, edge cases
  • Manual test: temp repo with .husky/_/ → warning with 4 hook commands shown
  • Manual test: temp repo with lefthook.yml → note shown
  • Manual test: clean repo → no warning

closes #228

🤖 Generated with Claude Code

Detect Husky, Lefthook, pre-commit, and Overcommit via filesystem
checks and show actionable warnings after hook installation. Husky
users get copy-paste instructions for durable integration; other
managers get a note to re-run `entire enable` if hooks are overwritten.

Lefthook detection covers all valid config patterns:
{.,}lefthook{,-local}.{yml,yaml,json,toml}

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Entire-Checkpoint: 2939ce7ed7da
@squishykid squishykid requested a review from a team as a code owner February 17, 2026 11:41
Copilot AI review requested due to automatic review settings February 17, 2026 11:41
@cursor
Copy link

cursor bot commented Feb 17, 2026

PR Summary

Low Risk
Behavior change is limited to extra stdout/stderr warnings during hook installation, with no changes to hook install/remove logic or settings handling.

Overview
Adds detection of common external git hook managers during setup and surfaces guidance right after strategy.InstallGitHook runs.

New strategy.CheckAndWarnHookManagers does filesystem-only checks for Husky, Lefthook (all supported filename variants), pre-commit, and Overcommit; it prints a warning with copy/paste hook lines for managers likely to overwrite hooks (Husky) and a note for others. Includes comprehensive unit tests covering detection, deduping, and output formatting.

Written by Cursor Bugbot for commit bace45e. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

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

Adds filesystem-based detection of common external git hook managers during entire enable, and prints tailored guidance/warnings so users understand when/why Entire’s hooks may be overwritten and how to make integration durable (notably for Husky).

Changes:

  • Introduces hook-manager detection (Husky, Lefthook variants, pre-commit, Overcommit) and warning text generation.
  • Hooks the warning output into multiple enable/setup flows after hook installation.
  • Adds unit tests covering detection, deduping, warning formatting, and RepoRoot-based warning emission.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
cmd/entire/cli/strategy/hook_managers.go Implements detection + warning rendering and exposes CheckAndWarnHookManagers.
cmd/entire/cli/strategy/hook_managers_test.go Adds unit tests for detection and warning content/output.
cmd/entire/cli/setup.go Calls strategy.CheckAndWarnHookManagers after installing hooks in enable/setup flows.

Detect Husky, Lefthook, pre-commit, and Overcommit via filesystem
checks and show actionable warnings after hook installation. Husky
users get copy-paste instructions for durable integration; other
managers get a note to re-run `entire enable` if hooks are overwritten.

Lefthook detection covers all valid config patterns:
{.,}lefthook{,-local}.{yml,yaml,json,toml}

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Entire-Checkpoint: 2939ce7ed7da
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

@squishykid squishykid marked this pull request as draft February 17, 2026 12:10
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

@squishykid squishykid marked this pull request as ready for review February 17, 2026 12:48
@squishykid squishykid merged commit bc334ae into main Feb 17, 2026
3 checks passed
@squishykid squishykid deleted the feat/detect-hook-managers branch February 17, 2026 13:45
@Soph Soph mentioned this pull request Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

entire enable hooks ignored when core.hooksPath is overridden (Husky)

3 participants