chore: use enum.StrEnum and update ruff revision

This commit is contained in:
agatha 2026-03-15 18:09:34 -04:00
parent c69336a823
commit f45229ceb2
4 changed files with 10 additions and 10 deletions

View File

@ -1,13 +1,13 @@
repos: repos:
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.10 rev: v0.15.6
hooks: hooks:
- id: ruff - id: ruff
args: [--fix] args: [--fix]
- id: ruff-format - id: ruff-format
- repo: https://github.com/compilerla/conventional-pre-commit - repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.1.0 rev: v4.4.0
hooks: hooks:
- id: conventional-pre-commit - id: conventional-pre-commit
stages: [commit-msg] stages: [commit-msg]

View File

@ -17,12 +17,12 @@ test-docker:
docker compose -f docker-compose.yml -f docker-compose.test.yml down docker compose -f docker-compose.yml -f docker-compose.test.yml down
lint: lint:
uv run ruff check src/ tests/ uv run ruff check src/
uv run ruff format --check src/ tests/ uv run ruff format --check src/
lint-fix: lint-fix:
uv run ruff check --fix src/ tests/ uv run ruff check --fix src/
uv run ruff format src/ tests/ uv run ruff format src/
typecheck: typecheck:
uv run mypy src/ uv run mypy src/

View File

@ -9,7 +9,7 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship
from proxy_pool.db.base import Base, TimestampMixin, UUIDPrimaryKeyMixin from proxy_pool.db.base import Base, TimestampMixin, UUIDPrimaryKeyMixin
class CreditTxType(str, enum.Enum): class CreditTxType(str, enum.StrEnum):
PURCHASE = "purchase" PURCHASE = "purchase"
ACQUIRE = "acquire" ACQUIRE = "acquire"
REFUND = "refund" REFUND = "refund"

View File

@ -18,20 +18,20 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship
from proxy_pool.db.base import Base, TimestampMixin, UUIDPrimaryKeyMixin from proxy_pool.db.base import Base, TimestampMixin, UUIDPrimaryKeyMixin
class ProxyProtocol(str, enum.Enum): class ProxyProtocol(str, enum.StrEnum):
HTTP = "http" HTTP = "http"
HTTPS = "https" HTTPS = "https"
SOCKS4 = "socks4" SOCKS4 = "socks4"
SOCKS5 = "socks5" SOCKS5 = "socks5"
class ProxyStatus(str, enum.Enum): class ProxyStatus(str, enum.StrEnum):
UNCHECKED = "unchecked" UNCHECKED = "unchecked"
ACTIVE = "active" ACTIVE = "active"
DEAD = "dead" DEAD = "dead"
class AnonymityLevel(str, enum.Enum): class AnonymityLevel(str, enum.StrEnum):
TRANSPARENT = "transparent" TRANSPARENT = "transparent"
ANONYMOUS = "anonymous" ANONYMOUS = "anonymous"
ELITE = "elite" ELITE = "elite"