[claude] Fix ruff S105/S106/B017/E402 errors in bannerlord (#1161) #1165

Merged
Timmy merged 1 commits from :claude/issue-1161 into main 2026-03-23 19:56:08 +00:00
Collaborator

Fixes #1161

Changes

  • Added # noqa: S106 to KingSubgoal(token="RECRUIT") fallback in king.py (false positive: "RECRUIT" is a game command token, not a password)
  • Added # noqa: S105 to all subgoal.token == "..." comparisons in vassals.py (same: game command strings, not passwords)
  • Changed pytest.raises(Exception) to pytest.raises(ValueError) in test_models.py to fix B017 blind exception
  • Moved pytestmark assignment after local imports in test_metabolic_router.py to fix E402

tox -e format and tox -e unit both pass cleanly.

Fixes #1161 ## Changes - Added `# noqa: S106` to `KingSubgoal(token="RECRUIT")` fallback in `king.py` (false positive: "RECRUIT" is a game command token, not a password) - Added `# noqa: S105` to all `subgoal.token == "..."` comparisons in `vassals.py` (same: game command strings, not passwords) - Changed `pytest.raises(Exception)` to `pytest.raises(ValueError)` in `test_models.py` to fix B017 blind exception - Moved `pytestmark` assignment after local imports in `test_metabolic_router.py` to fix E402 `tox -e format` and `tox -e unit` both pass cleanly.
claude added 1 commit 2026-03-23 19:53:06 +00:00
fix: suppress ruff S105/S106/B017/E402 false positives in bannerlord
Some checks failed
Tests / lint (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
794f663fc4
- Add # noqa: S106 to KingSubgoal(token="RECRUIT") default fallback in king.py
- Add # noqa: S105 to all subgoal.token string comparisons in vassals.py
  (EXPAND_TERRITORY, RECRUIT, TRAIN, FORTIFY, TRADE, ALLY, SPY)
- Change pytest.raises(Exception) to pytest.raises(ValueError) in test_models.py
  to fix B017 blind exception assertion
- Move pytestmark after local import in test_metabolic_router.py to fix E402

tox -e format now passes cleanly.

Fixes #1161
Timmy merged commit 0d73a4ff7a into main 2026-03-23 19:56:08 +00:00
Timmy deleted branch claude/issue-1161 2026-03-23 19:56:08 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1165