Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit f1a02fe

Browse files
committed
feat(ui): Improve visual indication of optionality
Required fields are bold. Others are now regular emphasis.
1 parent f2fa36d commit f1a02fe

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

gitcommit/gitcommit.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def add_scope(commit_msg):
157157
"\nWhat is the scope / a noun describing section of repo? (try to keep under 15 characters)"
158158
)
159159
)
160-
text = Ansi.b_green("Scope (optional): ")
160+
text = Ansi.colour(Ansi.fg.bright_green, "Scope (optional): ")
161161
c_scope = prompt(ANSI(text)).strip()
162162

163163
if c_scope != "":
@@ -243,21 +243,24 @@ def add_body(commit_msg):
243243
if IS_BREAKING_CHANGE:
244244
Ansi.print_info(
245245
wrap_width(
246-
"\nYou must explain what has changed in this commit to cause breaking changes."
247-
"Press Esc before Enter to submit."
246+
[
247+
"\nExplain what has changed in this commit to cause breaking changes.",
248+
"Press Esc before Enter to submit.",
249+
]
248250
)
249251
)
250-
text = Ansi.b_green("Body (required) ┃ ")
252+
# text = Ansi.b_green("Body (required) ┃ ")
253+
text = Ansi.colour(Ansi.fg.bright_green, Ansi.bold, "Body ┃ ")
251254
else:
252255
Ansi.print_info(
253256
wrap_width(
254257
[
255-
"\nYou may provide additional contextual information about the code changes here.",
258+
"\nProvide additional contextual information about the changes here.",
256259
"Press Esc before Enter to submit.",
257260
]
258261
)
259262
)
260-
text = Ansi.b_green("Body (optional) ┃ ")
263+
text = Ansi.colour(Ansi.fg.bright_green, "Body (optional) ┃ ")
261264

262265
c_body = session.prompt(ANSI(text), validator=body_validator)
263266
c_body = c_body.strip() # remove leading/trailing whitespace
@@ -310,7 +313,7 @@ def add_footer(commit_msg):
310313
)
311314
)
312315

313-
text = Ansi.b_green("Footer (optional) ┃ ")
316+
text = Ansi.colour(Ansi.fg.bright_green, "Footer (optional) ┃ ")
314317
session = PromptSession(
315318
completer=FooterCompleter(),
316319
multiline=False,

0 commit comments

Comments
 (0)