mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-10-29 00:18:08 +08:00
Upgrade and apply Ruff linting
This commit is contained in:
@ -11,11 +11,10 @@ class StrategyDestroyNotSupportedError(Exception):
|
||||
class Strategy(Protocol, Generic[models.UP, models.ID]):
|
||||
async def read_token(
|
||||
self, token: Optional[str], user_manager: BaseUserManager[models.UP, models.ID]
|
||||
) -> Optional[models.UP]:
|
||||
... # pragma: no cover
|
||||
) -> Optional[models.UP]: ... # pragma: no cover
|
||||
|
||||
async def write_token(self, user: models.UP) -> str:
|
||||
... # pragma: no cover
|
||||
async def write_token(self, user: models.UP) -> str: ... # pragma: no cover
|
||||
|
||||
async def destroy_token(self, token: str, user: models.UP) -> None:
|
||||
... # pragma: no cover
|
||||
async def destroy_token(
|
||||
self, token: str, user: models.UP
|
||||
) -> None: ... # pragma: no cover
|
||||
|
||||
@ -13,11 +13,9 @@ class TransportLogoutNotSupportedError(Exception):
|
||||
class Transport(Protocol):
|
||||
scheme: SecurityBase
|
||||
|
||||
async def get_login_response(self, token: str) -> Response:
|
||||
... # pragma: no cover
|
||||
async def get_login_response(self, token: str) -> Response: ... # pragma: no cover
|
||||
|
||||
async def get_logout_response(self) -> Response:
|
||||
... # pragma: no cover
|
||||
async def get_logout_response(self) -> Response: ... # pragma: no cover
|
||||
|
||||
@staticmethod
|
||||
def get_openapi_login_responses_success() -> OpenAPIResponseType:
|
||||
|
||||
@ -7,14 +7,11 @@ from passlib.context import CryptContext
|
||||
class PasswordHelperProtocol(Protocol):
|
||||
def verify_and_update(
|
||||
self, plain_password: str, hashed_password: str
|
||||
) -> Tuple[bool, str]:
|
||||
... # pragma: no cover
|
||||
) -> Tuple[bool, str]: ... # pragma: no cover
|
||||
|
||||
def hash(self, password: str) -> str:
|
||||
... # pragma: no cover
|
||||
def hash(self, password: str) -> str: ... # pragma: no cover
|
||||
|
||||
def generate(self) -> str:
|
||||
... # pragma: no cover
|
||||
def generate(self) -> str: ... # pragma: no cover
|
||||
|
||||
|
||||
class PasswordHelper(PasswordHelperProtocol):
|
||||
|
||||
@ -82,7 +82,7 @@ lint = [
|
||||
"isort ./docs/src -o fastapi_users",
|
||||
"isort ./examples -o fastapi_users -p app",
|
||||
"ruff format .",
|
||||
"ruff --fix .",
|
||||
"ruff check --fix .",
|
||||
"mypy fastapi_users/",
|
||||
]
|
||||
lint-check = [
|
||||
@ -90,7 +90,7 @@ lint-check = [
|
||||
"isort --check-only ./docs/src -o fastapi_users",
|
||||
"isort --check-only ./examples -o fastapi_users -p app",
|
||||
"ruff format .",
|
||||
"ruff .",
|
||||
"ruff check .",
|
||||
"mypy fastapi_users/",
|
||||
]
|
||||
docs = "mkdocs serve"
|
||||
|
||||
Reference in New Issue
Block a user