Fix python formatting and linting.
All checks were successful
CI / backend-lint (pull_request) Successful in 8s
CI / frontend-lint (pull_request) Successful in 29s

This commit is contained in:
2026-02-14 09:59:38 +01:00
parent 57023fc52a
commit 0728d55f06
4 changed files with 26 additions and 11 deletions

View File

@@ -1,11 +1,11 @@
---
# nuzlocke-tracker-5tac
title: Enable naming generator for Genlockes
status: in-progress
status: completed
type: task
priority: normal
created_at: 2026-02-11T21:14:21Z
updated_at: 2026-02-14T08:37:11Z
updated_at: 2026-02-14T08:52:16Z
---
## Overview

View File

@@ -9,7 +9,6 @@ Create Date: 2026-02-14 00:00:00.000000
from collections.abc import Sequence
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.

View File

@@ -8,6 +8,7 @@ from sqlalchemy.orm import joinedload, selectinload
from app.core.database import get_session
from app.models.boss_result import BossResult
from app.models.encounter import Encounter
from app.models.evolution import Evolution
from app.models.game import Game
from app.models.genlocke import GenlockeLeg
from app.models.genlocke_transfer import GenlockeTransfer
@@ -19,10 +20,13 @@ from app.schemas.run import (
RunResponse,
RunUpdate,
)
from app.models.evolution import Evolution
from app.models.genlocke import Genlocke
from app.services.families import build_families
from app.services.naming import get_naming_categories, strip_roman_suffix, suggest_names, to_roman
from app.services.naming import (
get_naming_categories,
strip_roman_suffix,
suggest_names,
to_roman,
)
router = APIRouter()

View File

@@ -1,6 +1,6 @@
import json
import re
import random
import re
from functools import lru_cache
from pathlib import Path
@@ -28,12 +28,24 @@ def get_words_for_category(category: str) -> list[str]:
_ROMAN_NUMERALS = [
(1000, "M"), (900, "CM"), (500, "D"), (400, "CD"),
(100, "C"), (90, "XC"), (50, "L"), (40, "XL"),
(10, "X"), (9, "IX"), (5, "V"), (4, "IV"), (1, "I"),
(1000, "M"),
(900, "CM"),
(500, "D"),
(400, "CD"),
(100, "C"),
(90, "XC"),
(50, "L"),
(40, "XL"),
(10, "X"),
(9, "IX"),
(5, "V"),
(4, "IV"),
(1, "I"),
]
_ROMAN_SUFFIX_RE = re.compile(r"\s+(M{0,3}(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3}))$")
_ROMAN_SUFFIX_RE = re.compile(
r"\s+(M{0,3}(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3}))$"
)
def to_roman(n: int) -> str: