style: отформатировать validator.py с black

This commit is contained in:
qwen.ai[bot] 2026-08-12 13:21:46 +00:00
parent f99a06985e
commit 34a0e193ac

View file

@ -9,11 +9,11 @@ import typer
# Запрещённые префиксы (private, reserved, multicast)
FORBIDDEN_PREFIXES: Final = [
"127.", # localhost
"0.", # current network
"10.", # private class A
"127.", # localhost
"0.", # current network
"10.", # private class A
"192.168.", # private class C
"172.16.", # private class B (начало диапазона)
"172.16.", # private class B (начало диапазона)
"172.17.",
"172.18.",
"172.19.",
@ -29,12 +29,12 @@ FORBIDDEN_PREFIXES: Final = [
"172.29.",
"172.30.",
"172.31.",
"224.", # multicast
"240.", # reserved
"::1", # IPv6 localhost
"fe80:", # IPv6 link-local
"fc00:", # IPv6 unique local
"fd00:", # IPv6 unique local
"224.", # multicast
"240.", # reserved
"::1", # IPv6 localhost
"fe80:", # IPv6 link-local
"fc00:", # IPv6 unique local
"fd00:", # IPv6 unique local
]
@ -89,9 +89,7 @@ def validate_bind_address(value: str) -> str:
try:
ipaddress.ip_address(value)
except ValueError:
raise typer.BadParameter(
f"'{value}' is not a valid IP address for --my-server"
)
raise typer.BadParameter(f"'{value}' is not a valid IP address for --my-server")
return value
@ -109,7 +107,5 @@ def validate_port(value: int) -> int:
typer.BadParameter: Если порт вне диапазона
"""
if not (1 <= value <= 65535):
raise typer.BadParameter(
f"Port {value} must be between 1 and 65535"
)
raise typer.BadParameter(f"Port {value} must be between 1 and 65535")
return value