Skip to content

style(lint): re-tighten E741/E731 and drop tests F401 exemption (follow-up to #17) - #18

Merged
mambo-wang merged 3 commits into
developfrom
chore/lint-tighten-post-17
Aug 26, 2026
Merged

style(lint): re-tighten E741/E731 and drop tests F401 exemption (follow-up to #17)#18
mambo-wang merged 3 commits into
developfrom
chore/lint-tighten-post-17

Conversation

@mambo-wang

Copy link
Copy Markdown
Owner

Summary

Follow-up to #17: narrows the lint relaxation to what the codebase actually needs.

  • pyproject.toml: keep only E701/E702 in ignore (250+ legacy one-line multiple statements, cosmetic); re-enable E741/E731 and drop the tests/* F401 per-file exemption. E501 removed from ignore — it was never active under the pinned select.
  • Fix all 22 E741 sites (rename ambiguous lline/link/node)
  • Fix the single E731 site (lambdadef in test_existence_filter)
  • Clean 24 unused imports across codewiki/ and tests/ (F401)
  • Drop 2 unused locals (F841) in analysis.py / smoke_test_mcp.py
  • Remove stray one-off diagnostic script scripts/_tmp2.py (accidentally committed in 99e4c44) — it was also the trigger of the ruff formatter panic that forced fix(ci): relax ruff rules and fix test flakes #17 to drop the format CI step

Test plan

  • Full suite: 430 passed, 2 skipped (pytest -o addopts="" tests/ -q)
  • ruff check clean on all touched files under the tightened config
  • E741/E731 now report zero repo-wide; formatter panic gone after _tmp2.py removal (format-check restoration tracked separately)

Accidentally committed in 99e4c44. It also triggered a ruff formatter
panic (Annotation range beyond end of buffer) that forced PR #17 to
drop the ruff format CI step.
…ow-up to #17)

PR #17 relaxed the ruff config broadly to unblock CI. This narrows the
relaxation to what the codebase actually needs:

- pyproject: ignore only E701/E702 (250+ legacy one-line multiple
  statements, cosmetic); remove E741/E731/E501 from ignore (E501 was
  never active under the pinned select anyway) and drop the
  tests/* F401 per-file exemption
- fix all 22 E741 sites (rename ambiguous `l` to line/link/node)
- fix the single E731 site (lambda -> def in test_existence_filter)
- clean 24 unused imports across codewiki/ and tests/ (F401)
- drop 2 unused local variables (F841) in analysis.py / smoke_test_mcp.py

Full suite: 430 passed, 2 skipped. Touched files are clean under the
tightened config; remaining repo-wide violations (E701/E702/E402/etc.)
are untouched legacy counts.
@mambo-wang
mambo-wang merged commit 5dee7f5 into develop Aug 26, 2026
2 checks passed
mambo-wang added a commit that referenced this pull request Aug 26, 2026
PR #17/#18 处理过程的关键发现:ruff formatter panic 的元凶是误提交的
一次性诊断脚本 scripts/_tmp2.py(已删除);笔记同时记录恢复 CI format
检查的三个前置 TODO(仓库 Issues 已关闭,此笔记即记账处)。
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