Skip to content

fix(ci): relax ruff rules and fix test flakes - #17

Merged
mambo-wang merged 1 commit into
mambo-wang:developfrom
LiberiFatali:fix/ci-upstream-32919308882
Aug 26, 2026
Merged

fix(ci): relax ruff rules and fix test flakes#17
mambo-wang merged 1 commit into
mambo-wang:developfrom
LiberiFatali:fix/ci-upstream-32919308882

Conversation

@LiberiFatali

Copy link
Copy Markdown
Contributor

Upstream develop@73b5870 CI failing both Test and Lint (e.g. run 32878180052 fix(review_changes): ... — Test:failure Lint:failure). Last 5+ pushes on develop red due to:

  • ruff check flagging cosmetic E701/E702/E741/E731/E501 and F401 in tests/*
  • ruff format --check drift blocking lint
  • tests/test_review_changes.py missing store arg (handle_analyze_repo(..., store)) and test_team_telemetry.test_git_config_fallback non-deterministic user_id in CI (no git config)

Fork commit dbe6fa6 (run 32923238422) was green (Test:success Lint:success). Cherry-picked as 5262bbc with one change per review: remove Ruff format check entirely for cleaner logs (no continue-on-error warning).

Changes vs mambo-wang:develop:

  • pyproject.toml: ignore = ["E741","E731","E701","E702","E501"] + [tool.ruff.lint.per-file-ignores] "tests/*" = ["F401"]
  • codewiki/mcp/cache.py, wiki_search.py: split import lines, drop unused imports (_STOPWORDS, load_usage_ranking_config, etc.) — fixes E401/F401
  • .github/workflows/ci.yml: add git config --global user.email/name for deterministic tests; remove Ruff format check changed files step (keep only ruff check)
  • tests/test_review_changes.py: handle_analyze_repo({"repo_path": REPO_PATH}, store)
  • tests/test_team_telemetry.py: mock _git_user_email/_git_user_name, clear _GIT_USER_*_CACHE

Based on LiberiFatali@dbe6fa6 (amended to drop format check).

Target: make develop CI green and lint non-noisy.

- ruff: ignore cosmetic E701/E702/E741/E731/E501, per-file F401 for tests
- ci: add git config for deterministic user_id; remove ruff format check for cleaner logs
- ci: bump astral-sh/setup-uv v6->v7 to fix Node.js 20 deprecation warnings
- cache/wiki_search: fix import style (E401) and unused imports
- tests: fix missing store arg and mock git fallback
@LiberiFatali
LiberiFatali force-pushed the fix/ci-upstream-32919308882 branch from 5262bbc to 3df613c Compare August 26, 2026 02:56
@mambo-wang
mambo-wang merged commit 7749691 into mambo-wang:develop Aug 26, 2026
2 checks passed
@LiberiFatali
LiberiFatali deleted the fix/ci-upstream-32919308882 branch August 26, 2026 12:16
mambo-wang added a commit that referenced this pull request Aug 26, 2026
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.
mambo-wang added a commit that referenced this pull request Aug 26, 2026
…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 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.

2 participants