Skip to content

feat(hooks): support interactive hook scripts#1925

Open
PhilipNelson5 wants to merge 1 commit intocommitizen-tools:masterfrom
PhilipNelson5:feat/interactive-hooks
Open

feat(hooks): support interactive hook scripts#1925
PhilipNelson5 wants to merge 1 commit intocommitizen-tools:masterfrom
PhilipNelson5:feat/interactive-hooks

Conversation

@PhilipNelson5
Copy link
Copy Markdown
Contributor

@PhilipNelson5 PhilipNelson5 commented Apr 6, 2026

Description

When a pre/post bump hook needs user input it fails because stdin, stdout, and stderr are redirected. This feature adds a new cmd utility to run a command without capturing/redirecting input or output to the subprocess. This allows interactive hooks to request input and display output to the user interactively.

Checklist

Was generative AI tooling used to co-author this PR?

  • Yes (please specify the tool below)

Code Changes

  • Add test cases to all the changes you introduce
  • Run uv run poe all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
  • Update the documentation for the changes

Documentation Changes

  • Run uv run poe doc locally to ensure the documentation pages renders correctly
  • Check and fix any broken links (internal or external)

Expected Behavior

When a pre/post bump hook tries to get use input, it successfully does so.

Steps to Test This Pull Request

  1. configure a pre/post bump hook which prompts the user for input.
  2. run cz bump.
  3. the hook successfully requests user input and is able to capture it without issue.

Additional Context

@PhilipNelson5 PhilipNelson5 changed the title feat(hooks): support interactive hooks scripts feat(hooks): support interactive hook scripts Apr 6, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.88%. Comparing base (7c21c21) to head (8746afc).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
commitizen/cmd.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1925      +/-   ##
==========================================
- Coverage   97.99%   97.88%   -0.12%     
==========================================
  Files          60       60              
  Lines        2689     2689              
==========================================
- Hits         2635     2632       -3     
- Misses         54       57       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PhilipNelson5 PhilipNelson5 force-pushed the feat/interactive-hooks branch 2 times, most recently from 335f5c7 to 98d622f Compare April 6, 2026 21:42
@PhilipNelson5 PhilipNelson5 force-pushed the feat/interactive-hooks branch from 98d622f to 8746afc Compare April 6, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant