Skip to content

Align core Python codebase with current Ruff checks to unblock “Python Code Review (Ruff)” - #11

Closed
vkshdev with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-python-code-review-ruff
Closed

Align core Python codebase with current Ruff checks to unblock “Python Code Review (Ruff)”#11
vkshdev with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-python-code-review-ruff

Conversation

Copilot AI commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

The Python Code Review (Ruff) Actions job was failing because the repository no longer matched the lint/format expectations of the Ruff version installed in CI. This PR updates the core Python service and tests to satisfy current ruff check and ruff format --check behavior.

  • CI failure scope

    • Resolved broad Ruff violations in services/core (imports/order, formatting drift, simplifiable control/context patterns).
  • Targeted manual fixes where autofix was insufficient

    • Collapsed nested context managers into multi-context with statements (SIM117).
    • Replaced membership-on-.keys() with direct row access fallback for sqlite3.Row (SIM118/SIM401 compatible behavior).
    • Updated test context-manager __enter__ annotations to Self (PYI034).
    • Kept FastAPI query parameter alias behavior while explicitly suppressing Ruff’s B008 false-positive in endpoint signature.
  • Consistency pass

    • Applied Ruff formatting normalization across affected core modules/tests so formatter-check and linter enforce the same baseline going forward.

Example of a representative change:

# before
with self.connect() as connection:
    with connection:
        connection.execute(...)

# after
with self.connect() as connection, connection:
    connection.execute(...)

Copilot AI changed the title [WIP] Fix failing GitHub Actions job Python Code Review (Ruff) Align core Python codebase with current Ruff checks to unblock “Python Code Review (Ruff)” Jul 24, 2026
Copilot AI requested a review from vkshdev July 24, 2026 21:54
@vkshdev vkshdev closed this Jul 24, 2026
@vkshdev
vkshdev deleted the copilot/fix-python-code-review-ruff branch July 24, 2026 22:06
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.

2 participants