Skip to content

build(ruff): select RUF100 and drop four stale noqa comments - #730

Merged
napetrov merged 2 commits into
intel:mainfrom
napetrov:noqa-codes
Nov 14, 2026
Merged

napetrov merged 2 commits into
intel:mainfrom
napetrov:noqa-codes

Conversation

@napetrov

Copy link
Copy Markdown
Contributor

Follow-up to #729: the task asked for PGH004 (blanket # noqa). It is already selected through "PGH" in [tool.ruff.lint], and ruff check --select PGH004 reports no site at main (a probe file with a codeless # noqa does get flagged, so the rule is live). So this PR adds the cheap neighbour instead:

  • RUF100 (unused noqa) selected. It found 4 stale # noqa: F401 comments, where the import is now used in the module (arm_runner.py, container_agent.py, docker_solver.py, mcp_protocol.py). They are removed; the "re-exported" notes stay as plain comments.
  • lint.external lists the noqa codes of rules dokimi does not select (ARG001, BLE001, E402, E731, N802, N818, S310), so RUF100 leaves those 34 comments alone. BLE001 can come off the list once Enable ruff BLE001/S110/S112: no silent except #729 selects it.
  • The pyproject comment that deferred RUF100 is removed; changelog fragment added. No runtime change.

Checks: ruff check . passes; scripts/check_comment_blocks.py passes. Tests for the touched modules: 297 passed; 8 test_container_agent.py failures also fail on origin/main on this Windows box (path separators, Docker), so they are not from this change. Local self-review (L1, one pass): no blockers.

🤖 Generated with Claude Code

PGH004 (blanket noqa) is already selected through PGH and reports no site.
RUF100 now flags a noqa that silences nothing. The four noqa: F401 comments
it found are removed; the re-export notes stay as plain comments. Codes of
rules not selected here go in lint.external so their noqa comments stay.

Signed-off-by: Petrov, Nikolay A <nikolay.a.petrov@intel.com>
@napetrov
napetrov requested a review from a team as a code owner November 13, 2026 21:48
Copilot AI balanced review requested due to automatic review settings November 13, 2026 21:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the change enabling unused-noqa checks and removing stale suppressions.

No open issues 🎉

What changed in this PR

0 new findings; nothing to fix.

This PR strengthens dokimi’s lint checks by enabling Ruff’s unused-noqa rule, following up on #729 without changing runtime behavior.

Changes:

  • Enable RUF100 and preserve suppressions for unselected rules through lint.external.
  • Remove four stale F401 suppressions while retaining existing re-export notes.
  • Remove the obsolete deferral comment and add a changelog fragment.
File Description
dokimi/​pyproject.toml Enable RUF100, configure external codes, and remove its deferral note.
dokimi/​dokimi/​mcp/​mcp_protocol.py Remove the stale suppression from the MCP SDK import.
dokimi/​dokimi/​harnesses/​docker_solver.py Remove the stale suppression; retain the re-export note.
dokimi/​dokimi/​harnesses/​container_agent.py Remove the stale suppression from the timeout import.
dokimi/​dokimi/​eval/​arm_runner.py Remove the stale suppression; retain the re-export note.
dokimi/​changelog.d/​20261113_120000_napetrov_ruf100-unused-noqa.md Document the lint rule and suppression cleanup.

Review effort: Balanced

@exai-bot

exai-bot commented Nov 13, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 6 selected item(s).

CI at e9608be: 33 passing, 4 skipped.

Review details
  • Commit reviewed: e9608be against merge base 60044a8
  • Coverage: 6 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 30k tokens (13k from cache), 7s
  • Tool calls: 5 (2 file_read, 1 ci_status, 1 code_search, 1 local_check_results)
  • Enable unused-noqa linting and clean up suppressions: 6 files

@xaleryb

xaleryb commented Nov 14, 2026

Copy link
Copy Markdown
Contributor
  • Ran on the head merged with current main: ruff check ., mypy, bandit -ll, the strict docs gate, an AST comparison of the four touched modules, and three probe files against the new config.
  • ruff check . exits 0. A stale # noqa: F401 is flagged (rc 1); a noqa for a code in lint.external (E731) passes; a noqa for a rule that is neither selected nor external (PLR0911) is flagged. Main has no site that would block other PRs, and none of the external codes is selected.
  • The ASTs of the four modules match main, so there is no runtime change.
  • Static checks was red only on the old base (CLI snapshot size); the branch is now updated with main. Approving once that run is green.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.72%. Comparing base (60044a8) to head (e9608be).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #730   +/-   ##
=======================================
  Coverage   95.72%   95.72%           
=======================================
  Files         405      405           
  Lines       54211    54211           
  Branches     9325     9325           
=======================================
  Hits        51895    51895           
  Misses       1430     1430           
  Partials      886      886           
Files with missing lines Coverage Δ
dokimi/dokimi/eval/arm_runner.py 95.87% <100.00%> (ø)
dokimi/dokimi/harnesses/container_agent.py 97.87% <100.00%> (ø)
dokimi/dokimi/harnesses/docker_solver.py 97.74% <100.00%> (ø)
dokimi/dokimi/mcp/mcp_protocol.py 62.30% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xaleryb xaleryb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked on the head merged with main: ruff, mypy, bandit and the strict docs gate pass; RUF100 flags a stale noqa, passes a noqa for an external code, and flags one for an unselected rule; the four touched modules have the same AST as main. Static checks is green after the update with main; the PR's own diff is unchanged.

@napetrov
napetrov merged commit 7f26ec4 into intel:main Nov 14, 2026
37 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.

5 participants