Skip to content

Commit 6245f15

Browse files
committed
fix: set default for interactive confirmation prompts
The default value for the confirmation prompts in interactive mode has been changed to `False` for editing and `True` for committing. This ensures a more intuitive user experience by requiring explicit confirmation for editing while defaulting to committing the generated message.
1 parent 4bcd9a9 commit 6245f15

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

smart_commit/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def generate(
425425

426426
# Interactive editing
427427
if interactive and not auto_commit:
428-
if Confirm.ask("\nWould you like to edit the message?"):
428+
if Confirm.ask("\nWould you like to edit the message?", default=False):
429429
commit_message = _edit_message_interactive(commit_message)
430430

431431
# Commit or confirm
@@ -434,7 +434,7 @@ def generate(
434434
if auto_commit:
435435
should_commit = True
436436
elif interactive:
437-
should_commit = Confirm.ask("\nProceed with this commit message?")
437+
should_commit = Confirm.ask("\nProceed with this commit message?", default=True)
438438
else:
439439
# Non-interactive mode commits by default
440440
should_commit = True
@@ -1092,15 +1092,15 @@ def _generate_from_template(template_name: str, auto_commit: bool, interactive:
10921092

10931093
# Interactive editing
10941094
if interactive and not auto_commit:
1095-
if Confirm.ask("\nWould you like to edit the message?"):
1095+
if Confirm.ask("\nWould you like to edit the message?", default=False):
10961096
commit_message = _edit_message_interactive(commit_message)
10971097

10981098
# Commit logic
10991099
should_commit = False
11001100
if auto_commit:
11011101
should_commit = True
11021102
elif interactive:
1103-
should_commit = Confirm.ask("\nProceed with this commit message?")
1103+
should_commit = Confirm.ask("\nProceed with this commit message?", default=True)
11041104
else:
11051105
should_commit = True
11061106

0 commit comments

Comments
 (0)