Python 포맷팅과 pre-commit 설정
맥락: - Python 코드만 대상으로 Ruff 기반 format/lint와 pre-commit hook을 도입한다. - Cython game.pyx는 Ruff 대상에서 제외해 포맷터 충돌을 피한다. 변경: - ruff와 pre-commit dev dependency 및 Ruff 설정을 추가했다. - pre-commit config와 Python format/check 스크립트를 추가했다. - Ruff format/check --fix 결과로 Python import 정렬과 포맷을 적용했다. 확인: - uv sync --extra gui - uv run pre-commit run --all-files - scripts/check-python.sh - uv run lost-cities-classic
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from coolrl_lost_cities.games.classic.bots import RandomBot
|
||||
from coolrl_lost_cities.games.classic.game import Card, GameState, LostCitiesConfig
|
||||
|
||||
from coolrl_lost_cities.games.classic.bots import RandomBot
|
||||
|
||||
|
||||
def test_legal_mask_has_action_in_nonterminal_phases() -> None:
|
||||
state = GameState.new_game(LostCitiesConfig(seed=3))
|
||||
@@ -39,8 +40,8 @@ def test_unified_legal_mask_has_fixed_shape_across_phases() -> None:
|
||||
mask = state.unified_legal_mask()
|
||||
assert state.phase == "draw"
|
||||
assert len(mask) == config.action_size
|
||||
assert all(value is False for value in mask[:config.card_action_size])
|
||||
assert any(mask[config.card_action_size:])
|
||||
assert all(value is False for value in mask[: config.card_action_size])
|
||||
assert any(mask[config.card_action_size :])
|
||||
|
||||
|
||||
def test_random_fuzz_invariants() -> None:
|
||||
|
||||
Reference in New Issue
Block a user