bugfix: commit small improvements #69

Merged
jt merged 4 commits from bugfix/commit-small-improvements into main 2026-09-28 17:27:54 +00:00
5 changed files with 8 additions and 9 deletions
Showing only changes of commit 76dd177421 - Show all commits
+4 -5
View File
@@ -52,15 +52,14 @@ def ensure_initialized():
) )
def ensure_right_branch(): def ensure_on_branch():
branch = Git.get_current_branch() branch = Git.get_current_branch()
if branch == "HEAD": if branch == "HEAD":
raise GitFlowError("No se encuentra parado sobre una rama.") raise GitFlowError("No se encuentra parado sobre una rama.")
elif io_confirm(f"Rama actual: {branch}. ¿Es correcto?"):
return branch io_info(f"Rama actual: {branch}")
else: return branch
raise GitFlowError("Ejecución cancelada.")
def get_branch_env_and_type(branch: str) -> tuple[str, str]: def get_branch_env_and_type(branch: str) -> tuple[str, str]:
+1 -1
View File
@@ -16,7 +16,7 @@ app = typer.Typer()
def commit(): def commit():
"""Crea un commit siguiendo el formato de Conventional Commits""" """Crea un commit siguiendo el formato de Conventional Commits"""
base.ensure_initialized() base.ensure_initialized()
branch = base.ensure_right_branch() branch = base.ensure_on_branch()
# Una rama WIP termina squasheando en su rama original, que tampoco puede ser un entorno # Una rama WIP termina squasheando en su rama original, que tampoco puede ser un entorno
target_branch = branch.removeprefix(WIP_BRANCH_PREFIX) target_branch = branch.removeprefix(WIP_BRANCH_PREFIX)
+1 -1
View File
@@ -15,7 +15,7 @@ def merge():
"""Realiza el merge de la rama, o crea el PR para hacerlo si tiene un remoto configurado""" """Realiza el merge de la rama, o crea el PR para hacerlo si tiene un remoto configurado"""
base.ensure_initialized() base.ensure_initialized()
branch = base.ensure_right_branch() branch = base.ensure_on_branch()
if branch in base.environments: if branch in base.environments:
if branch == base.environments[-1]: if branch == base.environments[-1]:
+1 -1
View File
@@ -14,7 +14,7 @@ def new():
"""Crea una nueva rama siguiendo Conventional Branches""" """Crea una nueva rama siguiendo Conventional Branches"""
base.ensure_initialized() base.ensure_initialized()
branch = base.ensure_right_branch() branch = base.ensure_on_branch()
if branch not in base.environments: if branch not in base.environments:
base.io_warning("La rama actual no corresponde a un entorno configurado.") base.io_warning("La rama actual no corresponde a un entorno configurado.")
+1 -1
View File
@@ -12,7 +12,7 @@ def release():
"""Realiza el merge de la rama, o crea el PR para hacerlo si tiene un remoto configurado""" """Realiza el merge de la rama, o crea el PR para hacerlo si tiene un remoto configurado"""
base.ensure_initialized() base.ensure_initialized()
branch = base.ensure_right_branch() branch = base.ensure_on_branch()
env, _ = base.get_branch_env_and_type(branch) env, _ = base.get_branch_env_and_type(branch)
if env == base.environments[-1]: if env == base.environments[-1]: