Migrated to ruff for faster, modern code formatting and linting: Configuration changes: - pyproject.toml: Added ruff 0.8.6, removed black/flake8 - Configured ruff with black-compatible formatting (88 chars) - Enabled comprehensive linting rules (pycodestyle, pyflakes, isort, pyupgrade, bugbear, comprehensions, simplify, return) - Updated CLAUDE.md: Changed code quality commands to use ruff Code improvements (490 auto-fixes): - Modernized type hints: List[T] → list[T], Dict[K,V] → dict[K,V], Optional[T] → T | None - Sorted all imports (isort integration) - Removed unused imports - Fixed whitespace issues - Reformatted 38 files for consistency Bug fixes: - app/core/play_resolver.py: Fixed type hint bug (any → Any) - tests/unit/core/test_runner_advancement.py: Removed obsolete random mock Testing: - All 739 unit tests passing (100%) - No regressions introduced 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
52 lines
1.0 KiB
Python
52 lines
1.0 KiB
Python
import logging
|
|
|
|
from fastapi import APIRouter
|
|
from pydantic import BaseModel
|
|
|
|
logger = logging.getLogger(f"{__name__}.games")
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
class GameListItem(BaseModel):
|
|
"""Game list item model"""
|
|
|
|
game_id: str
|
|
league_id: str
|
|
status: str
|
|
home_team_id: int
|
|
away_team_id: int
|
|
|
|
|
|
@router.get("/", response_model=list[GameListItem])
|
|
async def list_games():
|
|
"""
|
|
List all games
|
|
|
|
TODO Phase 2: Implement game listing with database query
|
|
"""
|
|
logger.info("List games endpoint called (stub)")
|
|
return []
|
|
|
|
|
|
@router.get("/{game_id}")
|
|
async def get_game(game_id: str):
|
|
"""
|
|
Get game details
|
|
|
|
TODO Phase 2: Implement game retrieval
|
|
"""
|
|
logger.info(f"Get game {game_id} endpoint called (stub)")
|
|
return {"game_id": game_id, "message": "Game retrieval stub"}
|
|
|
|
|
|
@router.post("/")
|
|
async def create_game():
|
|
"""
|
|
Create new game
|
|
|
|
TODO Phase 2: Implement game creation
|
|
"""
|
|
logger.info("Create game endpoint called (stub)")
|
|
return {"message": "Game creation stub"}
|