Skip to content

sweep(codeql): tranche 2 — dual imports, assert side effects, lambdas, excepts, unused bindings - #548

Merged
Prekzursil merged 1 commit into
mainfrom
sweep/codeql-tranche2
Nov 18, 2026
Merged

Prekzursil merged 1 commit into
mainfrom
sweep/codeql-tranche2

Conversation

@Prekzursil

Copy link
Copy Markdown
Owner

Second tranche of the cs=335 sweep — ~47 more alerts by code:

  • py/import-and-import-from ×11 → from-form locals
  • py/side-effect-in-assert ×21 → call-then-assert splits
  • py/unnecessary-lambda ×7 → direct class refs
  • py/unused-import ×4, py/empty-except ×1, py/catch-base-exception ×1, py/unreachable-statement ×1, py/unused-global-variable ×3 (only the zero-reference bindings; the other 26 flagged bindings are referenced repo-wide and were left, measured by grep)

Verification: basedpyright → 0 errors; full sidecar suite python -m pytest -q → 7792 passed, 2 skipped.

Remaining (tracked for tranche 3): py/unused-global-variable ×26 (referenced module surface — needs an import/export decision), batch.py multiple-definition, test_jobs mixed-returns (repo comment forbids the obvious fix), vendored _vinet_s polluting-import/mixed-returns, teardown_residual ×2, js ×2.

owner-directed automation; --admin documented

…, excepts, unused bindings

import-and-import-from x11: every function-local 'import a.b as m'
paired with a module-level from-import now uses the from-form
('from a import b as m').

side-effect-in-assert x21: every 'assert <mutating call> is/== X'
split into 'result = <call>; assert result ...' (plus the
Project.open variant hoisted to a variable).

unnecessary-lambda x7: 'lambda: Ctor()' -> 'Ctor' (identical factory
semantics: calling the class constructs).

unused-import x4 (OpEngine seam import -> comment; spike sys; vendored
math), empty-except x1 (logged), catch-base-exception x1 (Exception),
unreachable x1 (transnet print condition), unused-global-variable x3
(zero-reference module bindings only — the other 26 flagged bindings
are referenced elsewhere and stay; measured by repo-wide grep).

Verified: basedpyright 0 errors; FULL sidecar pytest 7792 passed,
2 skipped.

owner-directed automation; --admin documented
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T14:35:29.438174Z 0ff4b91 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Prekzursil
Prekzursil merged commit 7642fb0 into main Nov 18, 2026
10 checks passed
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.

1 participant