fix: remove empty if-pass stubs after db_post calls in complete_game (#38) #71

Closed
cal wants to merge 13 commits from ai/paper-dynasty-discord-38 into main
Owner

Summary

Removes two dead if len(resp) > 0: pass stubs in complete_game() (command_logic/logic_gameplay.py:4299-4309).

  • After posting plays/decisions to the API, the code captured resp = await db_post(...) and then immediately did if len(resp) > 0: pass — no actual validation, logging, or error handling.
  • Removed both stub if-blocks and the now-unused resp = variable assignments, replacing resp = await db_post(...) with plain await db_post(...).

Files Changed

  • command_logic/logic_gameplay.py — removed 6 lines of dead code (2 if-blocks + 2 resp = assignments + blank lines)

Notes

A ruff LSP auto-formatter also applied cosmetic reformatting to several unrelated sections of the file on save (blank line normalization, ternary/tuple formatting). These changes are purely stylistic and have no behavioral impact.

Tests

No test suite configured for this repo (per CLAUDE.md).

## Summary Removes two dead `if len(resp) > 0: pass` stubs in `complete_game()` (`command_logic/logic_gameplay.py:4299-4309`). - After posting plays/decisions to the API, the code captured `resp = await db_post(...)` and then immediately did `if len(resp) > 0: pass` — no actual validation, logging, or error handling. - Removed both stub `if`-blocks and the now-unused `resp =` variable assignments, replacing `resp = await db_post(...)` with plain `await db_post(...)`. ## Files Changed - `command_logic/logic_gameplay.py` — removed 6 lines of dead code (2 `if`-blocks + 2 `resp =` assignments + blank lines) ## Notes A ruff LSP auto-formatter also applied cosmetic reformatting to several unrelated sections of the file on save (blank line normalization, ternary/tuple formatting). These changes are purely stylistic and have no behavioral impact. ## Tests No test suite configured for this repo (per CLAUDE.md).
cal added 1 commit 2026-03-06 05:34:53 +00:00
fix: remove empty if-pass stubs after db_post calls in complete_game (#38)
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m22s
41c33e6d42
Removed two dead `if len(resp) > 0: pass` blocks after posting plays and
decisions to the API. These stubs had no effect and only created confusion.
Also removed the `resp =` assignments since the return values were never used.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cal added the
ai-reviewing
label 2026-03-06 05:45:35 +00:00
cal reviewed 2026-03-06 05:46:29 +00:00
cal left a comment
Author
Owner

AI Code Review

Files Reviewed

  • command_logic/logic_gameplay.py (modified)

Findings

Correctness

  • The two if len(resp) > 0: pass stubs are confirmed dead code — no validation, logging, or error handling was ever performed. Removing them is correct.
  • The resp = variable assignments are now unused after the stub removal; dropping them in favor of bare await db_post(...) is the right cleanup.
  • Minor note (pre-existing, out of scope): the if len(resp) > 0: pass checks would have raised a NameError if either db_post call threw an exception (since resp would be unassigned at that point). This PR implicitly removes that latent error path along with the dead stubs.

Security

  • No issues found.

Style & Conventions

  • Ruff cosmetic reformats (ternary parenthesization at lines 611–616 and 760–764, list comprehension at 1111–1113, multi-line function signature at 1222–1226, tuple unpacking at 3871–3878, blank line normalization) are purely stylistic — no behavioral change.

Suggestions

  • No suggestions.

Verdict: APPROVED

Clean dead-code removal. The resp = / if len(resp) > 0: pass pattern was a placeholder that never did anything; the refactored calls are clearer and equivalent. Ruff reformats are harmless. No blocking issues.


Automated review by Claude PR Reviewer

## AI Code Review ### Files Reviewed - `command_logic/logic_gameplay.py` (modified) ### Findings #### Correctness - The two `if len(resp) > 0: pass` stubs are confirmed dead code — no validation, logging, or error handling was ever performed. Removing them is correct. - The `resp =` variable assignments are now unused after the stub removal; dropping them in favor of bare `await db_post(...)` is the right cleanup. - Minor note (pre-existing, out of scope): the `if len(resp) > 0: pass` checks would have raised a `NameError` if either `db_post` call threw an exception (since `resp` would be unassigned at that point). This PR implicitly removes that latent error path along with the dead stubs. #### Security - No issues found. #### Style & Conventions - Ruff cosmetic reformats (ternary parenthesization at lines 611–616 and 760–764, list comprehension at 1111–1113, multi-line function signature at 1222–1226, tuple unpacking at 3871–3878, blank line normalization) are purely stylistic — no behavioral change. #### Suggestions - No suggestions. ### Verdict: APPROVED Clean dead-code removal. The `resp =` / `if len(resp) > 0: pass` pattern was a placeholder that never did anything; the refactored calls are clearer and equivalent. Ruff reformats are harmless. No blocking issues. --- *Automated review by Claude PR Reviewer*
cal added
ai-reviewed
and removed
ai-reviewing
labels 2026-03-06 05:46:54 +00:00
cal changed target branch from main to next-release 2026-03-07 07:32:50 +00:00
cal force-pushed ai/paper-dynasty-discord-38 from 41c33e6d42 to ec0945af3a 2026-03-07 07:34:01 +00:00 Compare
cal changed target branch from next-release to main 2026-03-23 04:14:35 +00:00
Author
Owner

Closing — will re-implement fresh against main. Original PR had unrebaseable conflicts from the scouting refactor.

Closing — will re-implement fresh against `main`. Original PR had unrebaseable conflicts from the scouting refactor.
cal closed this pull request 2026-03-23 04:15:44 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-discord#71
No description provided.