Feat: add live subject preview for interactive commit (--preview)#1902
Open
ttw225 wants to merge 20 commits intocommitizen-tools:masterfrom
Open
Feat: add live subject preview for interactive commit (--preview)#1902ttw225 wants to merge 20 commits intocommitizen-tools:masterfrom
ttw225 wants to merge 20 commits intocommitizen-tools:masterfrom
Conversation
CLI > config > default (0) for not limit
CLI > config > default (0) for not limit
use --preview in cli or preview = true in toml
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1902 +/- ##
==========================================
- Coverage 97.99% 97.79% -0.20%
==========================================
Files 60 62 +2
Lines 2689 2811 +122
==========================================
+ Hits 2635 2749 +114
- Misses 54 62 +8 ☔ View full report in Codecov by Sentry. |
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.
#1901
The implementation is based on Questionary's
bottom_toolbarDescription
--previewflag (and configpreview) to show a live first-line (subject) preview while typing duringcz commit.message_length_limit(0 disables limit).Checklist
Was generative AI tooling used to co-author this PR?
Generated-by: [Cursor] following the guidelines
Code Changes
uv run poe alllocally to ensure this change passes linter check and testsDocumentation Changes
uv run poe doclocally to ensure the documentation pages renders correctlyExpected Behavior
cz commit --previewshows a live subject preview and a character counter while answering interactive questions.Steps to Test This Pull Request
Manual:
cz commit --preview(observe live subject preview + counter)cz commit --preview -l 72(confirm counter showscurrent/72and validation triggers when exceeded)Additional Context
commitizen/interactive_preview.py,commitizen/preview_questions.pycommitizen/cli.pyadds--preview;commitizen/defaults.pyaddspreviewsetting (defaultFalse)docs/images/cli_interactive/commit_preview.gif,docs/images/cli_interactive/commit_preview_length_limit.gif(+.tape)