Skip to content

Commit 54e817e

Browse files
codeql: suppress py/ineffectual-statement (false positives)
Adds ``.github/codeql/codeql-config.yml`` with a query-filter exclude for ``py/ineffectual-statement``. The rule has produced zero true positives across the codebase; every finding has been the same false-positive pattern: - PEP 544 ``Protocol`` method bodies (``...``) on the eight Protocol classes the framework defines (``Provider``, ``Checkpointer``, ``Middleware``, ``Observer``, etc.). Canonical Python idiom — never executed. - ``await worker`` lines flagged as no-effect when ``await`` on a task is the entire mechanism that waits for the task to complete (CodeQL bug on async patterns). The genuine "unused statement" cases are caught at type-check time by pyright's ``reportUnusedExpression`` — suppressing the CodeQL rule doesn't lose any signal. To make GitHub's default-setup code scanning honor this config: Settings → Code security → Code scanning → CodeQL default setup → "Custom configuration" → point at ``.github/codeql/codeql-config.yml``. (Or switch to advanced setup; the file works either way once selected.)
1 parent d010d9b commit 54e817e

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/codeql/codeql-config.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "openarmature-python CodeQL config"
2+
3+
# CodeQL's Python ``code-quality`` suite includes
4+
# ``py/ineffectual-statement``, which produces a fixed false-positive
5+
# stream against this codebase:
6+
#
7+
# - PEP 544 ``Protocol`` method bodies use ``...`` (the canonical
8+
# Python idiom — never executed because Protocols are structural,
9+
# not inheritance-based). Replacing with ``raise NotImplementedError``
10+
# would imply ABC semantics that the protocol classes
11+
# intentionally don't have. Cited sites:
12+
# - ``llm/provider.py`` (Provider.ready / complete)
13+
# - ``checkpoint/protocol.py`` (Checkpointer.save / load / list /
14+
# delete)
15+
# - ``graph/middleware/_core.py`` (Middleware.__call__ + chain
16+
# callable)
17+
# - ``graph/observer.py`` (Observer.__call__)
18+
# - ``await worker`` after a queue sentinel in
19+
# ``tests/unit/test_observer.py`` is flagged as no-effect, but
20+
# ``await`` on a Task waits for completion — the entire reason
21+
# the line exists. CodeQL bug for async patterns.
22+
#
23+
# Each finding has been individually triaged across PR review rounds;
24+
# the rule has produced zero true positives. Suppressing the rule
25+
# repo-wide stops the regenerating noise without leaving real
26+
# unused-statement bugs un-caught (pyright's ``reportUnusedExpression``
27+
# already covers the genuine cases at type-check time).
28+
query-filters:
29+
- exclude:
30+
id: py/ineffectual-statement

0 commit comments

Comments
 (0)