Skip to content

Commit 9426b7e

Browse files
committed
feat(cli,config): add preview flag for live commit subject display
use --preview in cli or preview = true in toml
1 parent f5c4b48 commit 9426b7e

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

commitizen/cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ def __call__(
164164
"type": int,
165165
"help": "Set the length limit of the commit message; 0 for no limit.",
166166
},
167+
{
168+
"name": ["--preview"],
169+
"action": "store_true",
170+
"help": "Show live first-line (subject) preview while typing.",
171+
},
167172
{
168173
"name": ["--"],
169174
"action": "store_true",

commitizen/defaults.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class Settings(TypedDict, total=False):
6565
version_type: str | None
6666
version: str | None
6767
breaking_change_exclamation_in_title: bool
68+
preview: bool
6869

6970

7071
CONFIG_FILES: tuple[str, ...] = (
@@ -115,6 +116,7 @@ class Settings(TypedDict, total=False):
115116
"extras": {},
116117
"breaking_change_exclamation_in_title": False,
117118
"message_length_limit": 0, # 0 for no limit
119+
"preview": False,
118120
}
119121

120122
MAJOR = "MAJOR"

0 commit comments

Comments
 (0)