diff --git a/src/git_flow/remote/base.py b/src/git_flow/remote/base.py index ba6625e..4f8cecb 100644 --- a/src/git_flow/remote/base.py +++ b/src/git_flow/remote/base.py @@ -1,6 +1,7 @@ -import giturlparse from abc import ABC, abstractmethod +import giturlparse + from git_flow import SUPPORTED_REMOTE_URL_SCHEMAS, GitFlowError from git_flow.git import Git @@ -22,17 +23,23 @@ class RemoteAPI(ABC): """ url = Git("remote", "get-url", remote).firstline() - parsed_url = giturlparse.parse(url) # Validamos que la URL sea válida + parsed_url = giturlparse.parse(url) # Validamos que la URL sea válida if not parsed_url.valid: raise GitFlowError(f"La URL del remoto {remote} es inválida: {url}") if not parsed_url.protocol in SUPPORTED_REMOTE_URL_SCHEMAS: - raise GitFlowError(f"La URL del remoto {remote} no tiene un esquema soportado: {url}") + raise GitFlowError( + f"La URL del remoto {remote} no tiene un esquema soportado: {url}" + ) # Cuando el host es seteado por pipeline puede ser "http://gitea/OWNER/REPO", en ese caso # la libreria parsea OWNER="" y REPO="OWNER/REPO" - repository = "/".join(filter(None, [parsed_url.owner, parsed_url.repo])).removeprefix("/").removesuffix(".git") + repository = ( + "/".join(filter(None, [parsed_url.owner, parsed_url.repo])) + .removeprefix("/") + .removesuffix(".git") + ) return [parsed_url.protocol + "://", parsed_url.host, repository]