ruff: add RET lint

lints about assign and immediatly returning a variable
This commit is contained in:
Marcel Hellwig
2026-01-05 13:29:49 +01:00
parent 805a6981a6
commit 75406cbc64
17 changed files with 159 additions and 213 deletions

View File

@@ -23,21 +23,20 @@ def build_db_url(
host: str,
port: int | str,
dbname: str,
) -> str:
db_url = URL.create(
) -> URL:
return URL.create(
"postgresql+psycopg",
user,
password,
host,
port,
int(port),
dbname,
)
return db_url
def init_engine(
db_config: Any | None = None,
url: str | None = None,
url: str | URL | None = None,
) -> Engine:
"""
Initialize the global SQLAlchemy engine and session factory.