ci: add fastapi linter
This commit is contained in:
parent
90a2994dbe
commit
3fdaec3b47
2 changed files with 4 additions and 2 deletions
|
|
@ -58,6 +58,7 @@ select = [
|
||||||
"T20", # flake8-print
|
"T20", # flake8-print
|
||||||
"PLE", # pylint errors
|
"PLE", # pylint errors
|
||||||
"RUF",
|
"RUF",
|
||||||
|
"FAST", # fastapi
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.ruff.lint.mccabe]
|
[tool.ruff.lint.mccabe]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import hmac
|
import hmac
|
||||||
import logging
|
import logging
|
||||||
|
from typing import Annotated
|
||||||
|
|
||||||
from fastapi import APIRouter, BackgroundTasks, Header, Request
|
from fastapi import APIRouter, BackgroundTasks, Header, Request
|
||||||
|
|
||||||
|
|
@ -31,8 +32,8 @@ def _verify_github_signature(
|
||||||
async def receive_payload(
|
async def receive_payload(
|
||||||
background_tasks: BackgroundTasks,
|
background_tasks: BackgroundTasks,
|
||||||
request: Request,
|
request: Request,
|
||||||
x_github_event: str = Header(...),
|
x_github_event: Annotated[str, Header(...)],
|
||||||
x_hub_signature_256: str | None = Header(None),
|
x_hub_signature_256: Annotated[str | None, Header(None)],
|
||||||
) -> None:
|
) -> None:
|
||||||
body = await request.body()
|
body = await request.body()
|
||||||
if not _verify_github_signature(
|
if not _verify_github_signature(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue