fix: make cc2 validator board read errors concise (#3175)

This commit is contained in:
Bellman 2026-05-28 08:06:28 +09:00 committed by GitHub
parent 760e69675c
commit e17936158a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,7 +44,14 @@ def main() -> int:
args = parser.parse_args()
repo_root = args.repo_root.resolve()
board_path = args.board or (repo_root / ".omx" / "cc2" / "board.json")
try:
board = json.loads(board_path.read_text(encoding="utf-8"))
except FileNotFoundError:
print(f"error: board not found at {board_path}")
return 1
except json.JSONDecodeError as exc:
print(f"error: invalid board JSON at {board_path}: {exc}")
return 1
errors: list[str] = []
ids = set()
for index, item in enumerate(board.get("items", []), 1):