refactor: enforce consistent lint and formatting with pre-commit and CI - #20
Merged
mambo-wang merged 4 commits intoAug 27, 2026
Merged
Conversation
Contributor
Author
|
@mambo-wang Many of the code changes involve only reformatting. I have confirmed that all tests passed. |
- Format whole repo with ruff (one-time cleanup, 206 files) - Drop black, pin ruff==0.16.3, keep mypy as optional - Add pre-commit hook (ruff check --fix + ruff format) and restore CI format check on changed files - Add CONTRIBUTING.md and .git-blame-ignore-revs for blame hygiene - Fix remaining lint issues (bare except, F821) and ignore E402 for intentional sys.path imports Prevents repeat of CI failure #33059834372 where lint errors were only caught after push.
LiberiFatali
force-pushed
the
refactor/precommit-enforce
branch
from
August 27, 2026 12:56
729a121 to
50c8ab8
Compare
Contributors must fork mambo-wang/CodeWiki-Plus first, clone their fork, and add upstream remote — direct clone of upstream is read-only.
mambo-wang
approved these changes
Aug 27, 2026
mambo-wang
left a comment
Owner
There was a problem hiding this comment.
Reviewed and verified locally against the merge base (e92692b1):
- Blast-radius check: AST-compared all 184 changed
.pyfiles. Differences are limited to quote normalization, docstring whitespace normalization, signature re-wrapping, and F401 import removals. Every removed import was cross-checked repo-wide for re-export/consumer usage — none found (e.g.ComponentMetaconsumers already import fromcodewiki.mcp.cache;validate_api_keyconsumers import fromutils.validationdirectly). - Runtime: full test suite passes (428 passed / 2 skipped; the single failure in
test_review_changes.py::test_prepare_end_to_endreproduces on thedevelopbaseline and is pre-existing). Repo-wideruff check .andruff format --check .are green. - MCP surface:
tools/list(44 tools),prompts/list(18) andresources/list(3) are byte-identical between base and head; livetools/callsmoke tests succeed.
Two non-blocking follow-ups after merge: (1) append the actual squash-merge commit hash to .git-blame-ignore-revs (currently placeholder-only, and the suggested --grep string does not match this commit's message); (2) heads-up that the PR also reformats embedded Python code blocks in 24 markdown files — harmless, though generated repowiki/ docs will get the old formatting back on regeneration.
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.
Why
The recent CI failure was caused by small lint and formatting issues that were only caught after pushing. This PR makes those checks happen earlier — on the developer's machine before commit — and re-enables them as a required CI check, so the same failure won't happen again.
What this PR does
blacksetup and keepsruffas the single source of truth for both linting and formatting.ruff check+ruff format) that auto-fixes simple issues on every commit.CONTRIBUTING.mdwith setup and usage instructions.How to use after this lands
Hooks fix what they can locally; CI is the final gate.
mypyremains available locally (uv run mypy) but is not enforced.