Skip to content

Commit e255b11

Browse files
committed
ruff config
1 parent 829b13a commit e255b11

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

app/middleware/authorization_middleware.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from __future__ import annotations
1+
from collections.abc import Callable, Awaitable
22
from datetime import datetime, UTC
3-
from fastapi import FastAPI, Request, Response, Callable, Awaitable
3+
from fastapi import FastAPI, Request, Response
44
from fastapi.responses import JSONResponse
55
from fastapi_pundra.common.jwt_utils import decode_token
66
from fastapi_pundra.rest.exceptions import UnauthorizedException

app/schemas/user_schema.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@
55
class UserCreateSchema(BaseModel):
66
"""User create schema."""
77

8-
MIN_PASSWORD_LENGTH = 8
9-
108
name: str | None = None
119
email: EmailStr
1210
password: str
1311

1412
@field_validator("password")
15-
def validate_password(self, v: str) -> str:
13+
def validate_password(cls, v: str) -> str:
1614
"""Validate the password."""
17-
min_len_error = f"Password must be at least {self.MIN_PASSWORD_LENGTH} characters long"
15+
min_len = 8
16+
min_len_error = f"Password must be at least {min_len} characters long"
1817

19-
if len(v) < self.MIN_PASSWORD_LENGTH:
18+
if len(v) < min_len:
2019
raise ValueError(min_len_error)
2120

2221
return v

ruff.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ ignore = [
5050
"TD002", # Missing author in TODO
5151
"TD003", # Missing issue link in TODO
5252
"FIX002", # Line contains TODO, consider resolving the issue
53-
"COM812" # Missing trailing comma in Python 3.6+
53+
"COM812", # Missing trailing comma in Python 3.6+
54+
"N805", # Instance method first argument name should be 'self'
5455
]
5556

5657
# Allow unused variables when underscore-prefixed

0 commit comments

Comments
 (0)