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
|
||||
"PLE", # pylint errors
|
||||
"RUF",
|
||||
"FAST", # fastapi
|
||||
]
|
||||
|
||||
[tool.ruff.lint.mccabe]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import hmac
|
||||
import logging
|
||||
from typing import Annotated
|
||||
|
||||
from fastapi import APIRouter, BackgroundTasks, Header, Request
|
||||
|
||||
|
|
@ -31,8 +32,8 @@ def _verify_github_signature(
|
|||
async def receive_payload(
|
||||
background_tasks: BackgroundTasks,
|
||||
request: Request,
|
||||
x_github_event: str = Header(...),
|
||||
x_hub_signature_256: str | None = Header(None),
|
||||
x_github_event: Annotated[str, Header(...)],
|
||||
x_hub_signature_256: Annotated[str | None, Header(None)],
|
||||
) -> None:
|
||||
body = await request.body()
|
||||
if not _verify_github_signature(
|
||||
|
|
|
|||
Loading…
Reference in a new issue