-
Notifications
You must be signed in to change notification settings - Fork 10
feat(stack): add hooks subcommand for status display
#933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(stack): add hooks subcommand for status display
#933
Conversation
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
🧪 CI InsightsHere's what we observed from your CI run for 22edf5f. 🟢 All jobs passed!But CI Insights is watching 👀 |
dfaf488 to
d2b3175
Compare
d957766 to
2ddf3dd
Compare
d2b3175 to
843ec91
Compare
2ddf3dd to
3a3cb1c
Compare
843ec91 to
dd362a1
Compare
|
@jd this pull request is now in conflict 😩 |
dd362a1 to
c3dbb6e
Compare
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new stack hooks subcommand that displays the status of both git hooks and Claude hooks, improving the user experience by providing better visibility into hook installation state. The existing stack setup command is preserved as an alias for backwards compatibility.
Changes:
- Added new
stack hookscommand to display detailed hook status and optionally install/upgrade hooks with--setupflag - Refactored setup.py to extract helper functions (
_get_hook_command,_read_claude_settings,_claude_script_needs_update,_get_claude_hook_scripts) for better code organization - Added
get_hooks_status()and_get_claude_hooks_status()functions to gather detailed status information - Maintained backwards compatibility by making
stack setupan alias that calls the same underlying functions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| mergify_cli/tests/stack/test_setup.py | Added comprehensive tests for the new get_hooks_status() function and CLI commands, testing various hook installation states and command interactions |
| mergify_cli/stack/setup.py | Refactored to extract helper functions, added status-checking functions, and removed the check_only parameter from stack_setup() |
| mergify_cli/stack/cli.py | Added new hooks command with status display and setup functionality, updated setup command to delegate to new functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add a new `stack hooks` command that displays the status of both git hooks and Claude hooks. The existing `stack setup` command becomes an alias for `stack hooks --setup`. - `mergify stack hooks` shows detailed status of all hooks - `mergify stack hooks --setup` installs/upgrades hooks - `mergify stack hooks --setup --force` forces wrapper reinstall - `mergify stack setup` works as before (backwards compatible) - `mergify stack setup --check` shows status (deprecated in favor of `hooks`) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Change-Id: I45910d02a514ed45f8b6d0becf58d36dce2a51f5 Claude-Session-Id: 3dabd187-059b-40b7-9a52-a2542a27c752
c3dbb6e to
22edf5f
Compare
Merge Queue Status✅ The pull request has been merged at 22edf5f This pull request spent 14 seconds in the queue, with no time running CI. Required conditions to merge
|
Add a new
stack hookscommand that displays the status of both githooks and Claude hooks. The existing
stack setupcommand becomes analias for
stack hooks --setup.mergify stack hooksshows detailed status of all hooksmergify stack hooks --setupinstalls/upgrades hooksmergify stack hooks --setup --forceforces wrapper reinstallmergify stack setupworks as before (backwards compatible)mergify stack setup --checkshows status (deprecated in favor ofhooks)Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com