style: format with ruff
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -28,11 +29,17 @@ class RemoteAPI(ABC):
|
||||
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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user