Skip to content

Commit e797256

Browse files
committed
Upgrade and apply Ruff linting
1 parent e4d6923 commit e797256

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

fastapi_users/authentication/strategy/base.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ class StrategyDestroyNotSupportedError(Exception):
1111
class Strategy(Protocol, Generic[models.UP, models.ID]):
1212
async def read_token(
1313
self, token: Optional[str], user_manager: BaseUserManager[models.UP, models.ID]
14-
) -> Optional[models.UP]:
15-
... # pragma: no cover
14+
) -> Optional[models.UP]: ... # pragma: no cover
1615

17-
async def write_token(self, user: models.UP) -> str:
18-
... # pragma: no cover
16+
async def write_token(self, user: models.UP) -> str: ... # pragma: no cover
1917

20-
async def destroy_token(self, token: str, user: models.UP) -> None:
21-
... # pragma: no cover
18+
async def destroy_token(
19+
self, token: str, user: models.UP
20+
) -> None: ... # pragma: no cover

fastapi_users/authentication/transport/base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ class TransportLogoutNotSupportedError(Exception):
1313
class Transport(Protocol):
1414
scheme: SecurityBase
1515

16-
async def get_login_response(self, token: str) -> Response:
17-
... # pragma: no cover
16+
async def get_login_response(self, token: str) -> Response: ... # pragma: no cover
1817

19-
async def get_logout_response(self) -> Response:
20-
... # pragma: no cover
18+
async def get_logout_response(self) -> Response: ... # pragma: no cover
2119

2220
@staticmethod
2321
def get_openapi_login_responses_success() -> OpenAPIResponseType:

fastapi_users/password.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@
77
class PasswordHelperProtocol(Protocol):
88
def verify_and_update(
99
self, plain_password: str, hashed_password: str
10-
) -> Tuple[bool, str]:
11-
... # pragma: no cover
10+
) -> Tuple[bool, str]: ... # pragma: no cover
1211

13-
def hash(self, password: str) -> str:
14-
... # pragma: no cover
12+
def hash(self, password: str) -> str: ... # pragma: no cover
1513

16-
def generate(self) -> str:
17-
... # pragma: no cover
14+
def generate(self) -> str: ... # pragma: no cover
1815

1916

2017
class PasswordHelper(PasswordHelperProtocol):

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ lint = [
8282
"isort ./docs/src -o fastapi_users",
8383
"isort ./examples -o fastapi_users -p app",
8484
"ruff format .",
85-
"ruff --fix .",
85+
"ruff check --fix .",
8686
"mypy fastapi_users/",
8787
]
8888
lint-check = [
8989
"isort --check-only ./fastapi_users ./tests",
9090
"isort --check-only ./docs/src -o fastapi_users",
9191
"isort --check-only ./examples -o fastapi_users -p app",
9292
"ruff format .",
93-
"ruff .",
93+
"ruff check .",
9494
"mypy fastapi_users/",
9595
]
9696
docs = "mkdocs serve"

0 commit comments

Comments
 (0)