Skip to content

Commit 4cc7456

Browse files
committed
chore: format code with ruff
1 parent 00b2c89 commit 4cc7456

14 files changed

Lines changed: 33 additions & 29 deletions

File tree

templates/common/.env.prod.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ GUNICORN_MAX_REQUESTS=1000
5858
GUNICORN_MAX_REQUESTS_JITTER=100
5959

6060
# Traefik Dashboard (generate with: htpasswd -nb admin MySecret123)
61-
TRAEFIK_DASHBOARD_CREDENTIALS=user:admin:$2y$05$oBRNwn21n4kYB955UjK1feIfo/u7NSxGF3WioKOhrHzQBizx8xqxm
61+
TRAEFIK_DASHBOARD_CREDENTIALS="admin:$2y$05$oBRNwn21n4kYB955UjK1feIfo/u7NSxGF3WioKOhrHzQBizx8xqxm"
6262

6363
# CORS
6464
BACKEND_CORS_ORIGINS=["http://localhost:3000", "http://localhost:8080"]

templates/common/app/api/v1/api.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ from fastapi import APIRouter
55
from app.api.v1.endpoints import test
66

77
api_router = APIRouter()
8-
api_router.include_router(test.router)
8+
api_router.include_router(test.router)

templates/common/app/api/v1/endpoints/test.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ router = APIRouter()
77

88
@router.get("/test")
99
async def test():
10-
return {"message": "Hello World from Sohail!"}
10+
return {"message": "Hello World from Sohail!"}

templates/common/app/core/security.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ auth_backend = AuthenticationBackend(
2525
name="jwt",
2626
transport=bearer_transport,
2727
get_strategy=get_jwt_strategy,
28-
)
28+
)

templates/common/app/schemas/user.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ class UserCreate(schemas.BaseUserCreate):
1616

1717
class UserUpdate(schemas.BaseUserUpdate):
1818
first_name: str | None = None
19-
last_name: str | None = None
19+
last_name: str | None = None

templates/sqlalchemy/fullstack/alembic/env.py.j2

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import os
21
from logging.config import fileConfig
32

43
from alembic import context
54
from sqlalchemy import engine_from_config, pool
5+
from fastapi_users_db_sqlalchemy.generics import GUID
66

77
# this is the Alembic Config object, which provides
88
# access to the values within the .ini file in use.
@@ -19,10 +19,7 @@ fileConfig(config.config_file_name)
1919
# target_metadata = None
2020

2121
from app.db.base import Base # noqa
22-
from app.core.config import settings # noqa
23-
24-
# Import custom GUID type
25-
from fastapi_users_db_sqlalchemy.generics import GUID
22+
from app.core.config import settings # noqa
2623

2724

2825
def render_item(type_, obj, autogen_context):
@@ -60,7 +57,11 @@ def run_migrations_offline():
6057
"""
6158
url = get_url()
6259
context.configure(
63-
url=url, target_metadata=target_metadata, literal_binds=True, compare_type=True, render_item=render_item
60+
url=url,
61+
target_metadata=target_metadata,
62+
literal_binds=True,
63+
compare_type=True,
64+
render_item=render_item,
6465
)
6566

6667
with context.begin_transaction():
@@ -84,7 +85,10 @@ def run_migrations_online():
8485

8586
with connectable.connect() as connection:
8687
context.configure(
87-
connection=connection, target_metadata=target_metadata, compare_type=True, render_item=render_item
88+
connection=connection,
89+
target_metadata=target_metadata,
90+
compare_type=True,
91+
render_item=render_item,
8892
)
8993

9094
with context.begin_transaction():
@@ -94,4 +98,4 @@ def run_migrations_online():
9498
if context.is_offline_mode():
9599
run_migrations_offline()
96100
else:
97-
run_migrations_online()
101+
run_migrations_online()
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from sqlalchemy.orm import declarative_base
22

3-
Base = declarative_base()
3+
Base = declarative_base()

templates/sqlalchemy/fullstack/app/db/session.py.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from collections.abc import AsyncGenerator
44

5-
from sqlalchemy import create_engine
65
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
76
from sqlalchemy.orm import sessionmaker
87

@@ -24,10 +23,11 @@ AsyncSessionLocal = sessionmaker(
2423
expire_on_commit=False,
2524
)
2625

26+
2727
async def get_db() -> AsyncGenerator[AsyncSession, None]:
2828
"""Dependency to get async database session for FastAPI."""
2929
async with AsyncSessionLocal() as session:
3030
try:
3131
yield session
3232
finally:
33-
await session.close()
33+
await session.close()

templates/sqlalchemy/fullstack/app/users/__init__.py.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from fastapi import Depends
21
from fastapi_users import FastAPIUsers
32
from uuid import UUID
43
from app.models.user import User

0 commit comments

Comments
 (0)