refactor: use base.io_ methods

This commit is contained in:
jt
2026-07-16 22:25:20 -03:00
parent e4833c9ed9
commit add4cd2747
3 changed files with 30 additions and 29 deletions
+11
View File
@@ -3,6 +3,7 @@ from git_flow import (
REPOSITORY_TOKEN_FILENAME,
FLOWCONFIG_FILENAME,
FLOWCONFIG_VERSION,
COMMIT_TYPES,
GitFlowError,
)
from git_flow.git import Git
@@ -147,6 +148,16 @@ def is_valid_ticket(ticket: str) -> bool:
)
def get_commit_message(commit_types: list[str] = COMMIT_TYPES) -> str:
commit_type = io_choice("Tipo de commit", commit_types)
commit_message = io_prompt(
"Mensaje de commit",
validator=lambda s: 0 < len(s) and len(s) < 100,
instruction="100 caracteres máximo",
)
return commit_type + ": " + commit_message
def io_error(message: str, title: Optional[str] = None):
_io_status(message, "✖ Error: ", "red", title)