Skip to content

MAINT: make puzzled dispatch exhaustive (P311-03) - #3504

Open
Slai.life (huong8373tt-beep) wants to merge 1 commit into
microsoft:mainfrom
huong8373tt-beep:fix/p311-03-puzzle-dispatch
Open

Slai.life (huong8373tt-beep) wants to merge 1 commit into
microsoft:mainfrom
huong8373tt-beep:fix/p311-03-puzzle-dispatch

Conversation

@huong8373tt-beep

@huong8373tt-beep Slai.life (huong8373tt-beep) commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • make the closed PuzzleType dispatch explicit for word-search, anagram, and crossword builders
  • add assert_never so a future enum member is rejected by type checking instead of falling through to the crossword builder
  • add an actual-source enum-extension regression probe while preserving constructor validation, crossword fallback, seeded RNG behavior, Unicode handling, clues, and rendered output

Part of #3166 (P311-03 puzzle-builder dispatch).

Validation

  • uv run pytest tests/unit/converter/test_puzzled_converter.py -q --basetemp .pytest-tmp-final (145 passed)
  • uv run ty check pyrit/converter/puzzled/puzzled_converter.py tests/unit/converter/test_puzzled_converter.py
  • uv run ruff format --check pyrit/converter/puzzled/puzzled_converter.py tests/unit/converter/test_puzzled_converter.py
  • uv run ruff check pyrit/converter/puzzled/puzzled_converter.py tests/unit/converter/test_puzzled_converter.py
  • git diff --check

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant