Skip to content

Commit

Permalink
Fix mypy discovery & all type errors across source (#507)
Browse files Browse the repository at this point in the history
* fix all mypy errors across all source files

* mp help for normal players fix

* remove unused typevar
  • Loading branch information
cmyui authored Sep 24, 2023
1 parent 3b2e9b4 commit 33b90a8
Show file tree
Hide file tree
Showing 14 changed files with 155 additions and 121 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ mypy = "*"
autoflake = "*"
asgi-lifespan = "*"
pytest-asyncio = "*"
types-psutil = "*"

[requires]
python_version = "3.11"
10 changes: 9 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions app/api/domains/cho.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@


@router.get("/")
async def bancho_http_handler():
async def bancho_http_handler() -> Response:
"""Handle a request from a web browser."""
new_line = "\n"
matches = [m for m in app.state.sessions.matches if m is not None]
Expand All @@ -109,7 +109,7 @@ async def bancho_http_handler():


@router.get("/online")
async def bancho_view_online_users():
async def bancho_view_online_users() -> Response:
"""see who's online"""
new_line = "\n"

Expand All @@ -132,7 +132,7 @@ async def bancho_view_online_users():


@router.get("/matches")
async def bancho_view_matches():
async def bancho_view_matches() -> Response:
"""ongoing matches"""
new_line = "\n"

Expand Down Expand Up @@ -173,7 +173,7 @@ async def bancho_handler(
request: Request,
osu_token: str | None = Header(None),
user_agent: Literal["osu!"] = Header(...),
):
) -> Response:
ip = app.state.services.ip_resolver.get_ip(request.headers)

if osu_token is None:
Expand Down
Loading

0 comments on commit 33b90a8

Please sign in to comment.