Skip to content

Commit

Permalink
Adapt code changes to the repo standards
Browse files Browse the repository at this point in the history
  • Loading branch information
IbraheemTuffaha committed Jul 23, 2024
1 parent 420a27c commit 89c75ad
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 21 deletions.
8 changes: 1 addition & 7 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ ignore =
WPS473,
; Found too many arguments
WPS211,
; Found local folder import
WPS300,
; multiple statements on one line (colon)
E701,
; Found incorrect node inside `class` body
WPS604,


per-file-ignores =
; all tests
test_*.py,tests.py,tests_*.py,*/tests/*,conftest.py:
Expand Down
5 changes: 2 additions & 3 deletions app/v1/routers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .base import router
__all__ = ["router"]


__all__ = ("router",)
from app.v1.routers.base import router
2 changes: 1 addition & 1 deletion app/v1/routers/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from fastapi import APIRouter

from .dummy import router as dummy_router
from app.v1.routers.dummy import router as dummy_router


router = APIRouter(prefix="/v1")
Expand Down
6 changes: 3 additions & 3 deletions app/v1/routers/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
router = APIRouter()


@router.post("/capitalize", response_model=dummy_serializer.CapitalizeOut)
async def capitalize(request: dummy_serializer.CapitalizeIn) -> dict[str, str]:
return {"text": request.text.upper()}
@router.post("/capitalize")
async def capitalize(request: dummy_serializer.Capitalize) -> dummy_serializer.Capitalize:
return dummy_serializer.Capitalize(text=request.text.upper())
Empty file added app/v1/serializers/__init__.py
Empty file.
8 changes: 1 addition & 7 deletions app/v1/serializers/dummy.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
from pydantic import BaseModel


class BaseCapitalize(BaseModel):
class Capitalize(BaseModel):
text: str


class CapitalizeIn(BaseCapitalize): ...


class CapitalizeOut(BaseCapitalize): ...

0 comments on commit 89c75ad

Please sign in to comment.