style: format the last 10 files that ruff format disagreed with
ruff.toml has declared `quote-style = "single"` and line-length 120 since the lint job landed, and 118 of 128 files follow it. The panel backend and the netbox configuration were written in black/prettier style instead, so a `ruff format --check` would have failed on them from the start. Bring them onto the style the repository already declares, which is what makes the check adoptable at all. Formatting only: apart from quote style the diff is multi-line expressions joined where they fit inside 120 columns. Both suites still pass afterwards (25 pytest, and ruff check is clean). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
fddd82704f
commit
0ae0df7473
10 files changed
+320
-334
No files matched your search
@@ -5,13 +5,13 @@ from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
INSTANCE_PATTERN = r"^[a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])?$"
|
||||
INSTANCE_PATTERN = r'^[a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])?$'
|
||||
|
||||
|
||||
class Resources(BaseModel):
|
||||
storage: str = "1Gi"
|
||||
cpu_limit: str = "300m"
|
||||
memory_limit: str = "1536Mi"
|
||||
storage: str = '1Gi'
|
||||
cpu_limit: str = '300m'
|
||||
memory_limit: str = '1536Mi'
|
||||
|
||||
|
||||
class AccountBase(BaseModel):
|
||||
@@ -21,7 +21,7 @@ class AccountBase(BaseModel):
|
||||
api_hash: str = Field(min_length=16, max_length=128)
|
||||
resources: Resources = Field(default_factory=Resources)
|
||||
|
||||
@field_validator("display_name", "api_hash")
|
||||
@field_validator('display_name', 'api_hash')
|
||||
@classmethod
|
||||
def strip_text(cls, value: str) -> str:
|
||||
return value.strip()
|
||||
@@ -30,12 +30,12 @@ class AccountBase(BaseModel):
|
||||
class PhoneStart(AccountBase):
|
||||
phone: str = Field(min_length=7, max_length=32)
|
||||
|
||||
@field_validator("phone")
|
||||
@field_validator('phone')
|
||||
@classmethod
|
||||
def normalize_phone(cls, value: str) -> str:
|
||||
value = value.strip()
|
||||
if not value.startswith("+"):
|
||||
raise ValueError("phone must use international format")
|
||||
if not value.startswith('+'):
|
||||
raise ValueError('phone must use international format')
|
||||
return value
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@ class StringSessionStart(AccountBase):
|
||||
class CodeSubmit(BaseModel):
|
||||
code: str = Field(min_length=3, max_length=12)
|
||||
|
||||
@field_validator("code")
|
||||
@field_validator('code')
|
||||
@classmethod
|
||||
def normalize_code(cls, value: str) -> str:
|
||||
return "".join(value.split())
|
||||
return ''.join(value.split())
|
||||
|
||||
|
||||
class PasswordSubmit(BaseModel):
|
||||
@@ -67,7 +67,7 @@ class InstanceSummary(BaseModel):
|
||||
namespace: str
|
||||
deployment: str
|
||||
pod: str | None = None
|
||||
status: Literal["running", "stopped", "pending", "error"]
|
||||
status: Literal['running', 'stopped', 'pending', 'error']
|
||||
reason: str | None = None
|
||||
ready: bool = False
|
||||
restarts: int = 0
|
||||
@@ -84,6 +84,6 @@ class InstanceSummary(BaseModel):
|
||||
|
||||
|
||||
class AuthResult(BaseModel):
|
||||
status: Literal["code_required", "password_required", "ready"]
|
||||
status: Literal['code_required', 'password_required', 'ready']
|
||||
flow_id: str | None = None
|
||||
instance: InstanceSummary | None = None
|
||||
Reference in new issue
Block a user