refactor: use base.io_ methods
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user