fix: resolve CI failures on main — ruff lint + tomllib on Py3.10#220
Merged
fix: resolve CI failures on main — ruff lint + tomllib on Py3.10#220
Conversation
Main CI has been red for 13 consecutive pushes since #135. Root causes: Lint job (ruff): - skills.py: rename local vars _SCRIPT/_MARKER to lowercase (N806) - communities.py: wrap long INSERT INTO SQL across two lines (E501) - parser.py: strip trailing whitespace on Go field_identifier return (W291) - visualization.py: rephrase comment so ruff stops parsing the embedded "# noqa: E501" reference as a directive Test (3.10) job: - tests/test_skills.py: tomllib is Python 3.11+ only. Use conditional import with tomli as the backport on 3.10. - pyproject.toml: add "tomli>=2.0; python_version < '3.11'" to dev extras - uv.lock: regenerated (also picks up pytest-cov + coverage entries that were already in pyproject.toml dev extras but missing from the lock) Verified locally on Python 3.11: - ruff check code_review_graph/ — All checks passed - mypy code_review_graph/ — Success (44 source files) - bandit -r code_review_graph/ — 0 issues - pytest --cov-fail-under=65 — 661 passed, 1 skipped, 2 xpassed, 72.77% cov Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tirth8205
added a commit
that referenced
this pull request
Apr 11, 2026
Unreleased fixes since v2.2.2 that users are complaining about: - #208 Claude Code hook schema (fixes #97, #138, #163, #168, #172, #182, #188, #191, #201) — v2.2.2 generates an invalid hooks schema and timeouts in ms instead of seconds; PreCommit is also not a real event. - #205 SQLite transaction nesting (fixes #110, #135, #181) — implicit transactions from the legacy sqlite3 default caused "cannot start a transaction within a transaction" on update. - #166 Go method receivers resolved from field_identifier. - #170 UTF-8 decode errors in detect_changes (fixes #169). - #142 --platform target filters (fixes #133). - #213 / #183 large-repo community detection hangs. - #220 CI lint + tomllib on Python 3.10. - #159 missing pytest-cov dev dep. - #154 JSX component CALLS edges. Plus features: #177 Codex, #165 Luau (#153), #217 REFERENCES edge, #215 recurse_submodules, #185 gitignore default (#175), #171 gitignore docs (#157). Verified locally on Python 3.11: ruff clean, mypy clean, bandit clean, 691 tests pass, coverage 73.72%. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tirth8205
added a commit
that referenced
this pull request
Apr 11, 2026
Unreleased fixes since v2.2.2 that users are complaining about: - #208 Claude Code hook schema (fixes #97, #138, #163, #168, #172, #182, #188, #191, #201) — v2.2.2 generates an invalid hooks schema and timeouts in ms instead of seconds; PreCommit is also not a real event. - #205 SQLite transaction nesting (fixes #110, #135, #181) — implicit transactions from the legacy sqlite3 default caused "cannot start a transaction within a transaction" on update. - #166 Go method receivers resolved from field_identifier. - #170 UTF-8 decode errors in detect_changes (fixes #169). - #142 --platform target filters (fixes #133). - #213 / #183 large-repo community detection hangs. - #220 CI lint + tomllib on Python 3.10. - #159 missing pytest-cov dev dep. - #154 JSX component CALLS edges. Plus features: #177 Codex, #165 Luau (#153), #217 REFERENCES edge, #215 recurse_submodules, #185 gitignore default (#175), #171 gitignore docs (#157). Verified locally on Python 3.11: ruff clean, mypy clean, bandit clean, 691 tests pass, coverage 73.72%. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Main CI has been red for 13 consecutive pushes since
fix: resolve SQLite transaction nesting errors (#135, #181) (#205)landed. This PR fixes the actual root causes so themainbranch is green again.Root causes
Lint job (
ruff check code_review_graph/) — 4 errors + 1 warning:communities.py:564—E501Line too long (104 > 100) on anINSERT INTOSQL literalparser.py:2435—W291Trailing whitespace on the Gofield_identifierreturnskills.py:449/:456—N806local vars_SCRIPT/_MARKERinsideinstall_git_hookflagged as non-lowercasevisualization.py:415— Ruff was parsing`# noqa: E501`inside a comment explaining the per-file-ignore as a real noqa directive, which is invalid syntaxTest (3.10) job:
tests/test_skills.py:8—import tomllibfails on Python 3.10 (tomllib is 3.11+). Project still advertisesrequires-python = ">=3.10"and the CI matrix runs 3.10.Fixes
code_review_graph/skills.py_SCRIPT→script,_MARKER→markerininstall_git_hook(they were only used inside the function — no public API change)code_review_graph/communities.pyINSERT INTO communitiesSQL across two linescode_review_graph/parser.pycode_review_graph/visualization.pytests/test_skills.pyif sys.version_info >= (3, 11): import tomllib; else: import tomli as tomllibpyproject.toml"tomli>=2.0; python_version < '3.11'"todevextrasuv.locktomli, and also fills inpytest-cov+coverageentries that were already listed indevextras but missing from the lock on mainTest plan
Verified locally on Python 3.11:
uv run ruff check code_review_graph/→All checks passed!uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optional→Success: no issues found in 44 source filesuv run bandit -r code_review_graph/ -c pyproject.toml→ 0 High/Medium/Low issuesuv run pytest --tb=short -q --cov=code_review_graph --cov-fail-under=65→ 661 passed, 1 skipped, 2 xpassed, coverage 72.77% (gate is 65%)Not in scope
action_requiredstatus on 20+ other open PRs is GitHub's new-contributor CI gate, not a CI failure.🤖 Generated with Claude Code