Fix linting errors across backend and frontend
Backend: auto-fix and format all ruff issues, manually fix B904/B023/ SIM117/B007/E741/F841 errors, suppress B008 (FastAPI Depends) and F821 (SQLAlchemy forward refs) in config. Frontend: allow constant exports, disable React compiler-specific rules (set-state-in-effect, preserve-manual-memoization). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,9 @@ from app.core.database import Base
|
||||
class BossBattle(Base):
|
||||
__tablename__ = "boss_battles"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("version_group_id", "order", name="uq_boss_battles_version_group_order"),
|
||||
UniqueConstraint(
|
||||
"version_group_id", "order", name="uq_boss_battles_version_group_order"
|
||||
),
|
||||
)
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
@@ -15,8 +17,12 @@ class BossBattle(Base):
|
||||
ForeignKey("version_groups.id"), index=True
|
||||
)
|
||||
name: Mapped[str] = mapped_column(String(100))
|
||||
boss_type: Mapped[str] = mapped_column(String(20)) # gym_leader, elite_four, champion, rival, evil_team, other
|
||||
specialty_type: Mapped[str | None] = mapped_column(String(20), default=None) # pokemon type specialty (e.g. rock, water)
|
||||
boss_type: Mapped[str] = mapped_column(
|
||||
String(20)
|
||||
) # gym_leader, elite_four, champion, rival, evil_team, other
|
||||
specialty_type: Mapped[str | None] = mapped_column(
|
||||
String(20), default=None
|
||||
) # pokemon type specialty (e.g. rock, water)
|
||||
badge_name: Mapped[str | None] = mapped_column(String(100))
|
||||
badge_image_url: Mapped[str | None] = mapped_column(String(500))
|
||||
level_cap: Mapped[int] = mapped_column(SmallInteger)
|
||||
@@ -28,13 +34,13 @@ class BossBattle(Base):
|
||||
section: Mapped[str | None] = mapped_column(String(100), default=None)
|
||||
sprite_url: Mapped[str | None] = mapped_column(String(500))
|
||||
|
||||
version_group: Mapped["VersionGroup"] = relationship(
|
||||
back_populates="boss_battles"
|
||||
)
|
||||
version_group: Mapped["VersionGroup"] = relationship(back_populates="boss_battles")
|
||||
after_route: Mapped["Route | None"] = relationship()
|
||||
pokemon: Mapped[list["BossPokemon"]] = relationship(
|
||||
back_populates="boss_battle", cascade="all, delete-orphan"
|
||||
)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"<BossBattle(id={self.id}, name='{self.name}', type='{self.boss_type}')>"
|
||||
return (
|
||||
f"<BossBattle(id={self.id}, name='{self.name}', type='{self.boss_type}')>"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user