Repair pre-commit, drop pixi.lock, point .gitattributes at uv.lock - #67
Merged
Conversation
.pre-commit-config.yaml had rotted into a trap. It ran ruff-format while CI enforces black, and the two disagree: black reports the tree clean, ruff format rewrites five files, and black then rejects one of them. Any contributor who ran `pre-commit install` would have had their commits reformatted into a state that fails the lint job. It went unnoticed only because nothing runs it -- no git hook is installed and no workflow invokes it -- despite pre-commit sitting in the lint dependency group. Formatting is now black's alone, running after ruff-check so the formatter has the last word. Hook revs are current: ruff was pinned at 0.12.1 against a project on 0.16.3, and prettier pointed at pre-commit/mirrors-prettier, which upstream archived; that moves to the maintained rbubley fork. A pre-commit ecosystem is added to dependabot so these stop drifting silently. Deleting the config instead would have been simpler but would have dropped codespell, validate-pyproject, and prettier, none of which CI runs. With the hooks working, codespell found eleven hits. Five were false positives -- `lamda` is the LAMDA lab's domain in author emails, `anc` a local for "ancestors" -- and are now in ignore-words-list with a note. The other six are corrected, including "Subsequnce" in IKTOD's class docstring and a misspelled variable in a doctest example, both user-facing. prettier also normalized indentation in three workflow files and removed a blank line from mkdocs.yml, the first time it has run over them. Verified the parsed YAML is identical before and after, and that the docs still build under --strict. pixi.lock is removed: 438K of lockfile with no pixi.toml and no [tool.pixi] section, orphaned since the move to uv. .gitattributes existed only to mark it generated, so it now does the same for uv.lock, which collapses that file in diffs and keeps it out of language stats.
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.
Three related bits of housekeeping. The pre-commit part is the substantive one.
.pre-commit-config.yaml was a trap
It ran
ruff-formatwhile CI enforcesblack, and the two disagree:Any contributor who ran
pre-commit installwould have had their commits reformatted into a state that fails the lint job in CI. It went unnoticed only because nothing runs it — no git hook installed, no workflow invoking it — even thoughpre-commit>=4.3.0sits in the lint dependency group.Fixed by making formatting black's alone, running after
ruff-checkso the formatter has the last word.The revs had also rotted:
pre-commit/mirrors-prettierrbubley/mirrors-prettierv3.9.6pre-commit/mirrors-prettieris archived upstream. Apre-commitecosystem is added todependabot.ymlso these stop drifting silently — that drift is how it got here.Deleting the config would have been simpler, but it would have dropped codespell, validate-pyproject, and prettier, none of which CI runs.
[tool.codespell]in pyproject.toml is read by nothing else.What codespell found once it ran
Eleven hits. Five were false positives:
lamda×2 — the LAMDA lab's domain in author emails (mayx@lamda.nju.edu.cn)anc×3 — a local variable for "ancestors" in_inode.pyThose are now in
ignore-words-listwith a comment explaining why. The other six are real and corrected, two of them user-facing:Subsequnce→Subsequencein IKTOD's class docstringlables→labelsin a doctest example in_ikgod.py(last line of the example, nothing references it)dimention,Exsiting,commiting,continousChurn worth calling out
prettier normalized indentation in three workflow files and removed a blank line from
mkdocs.yml— the first time it has run over them. This is unrelated to the stated purpose of the PR, so:mkdocs.ymluses custom tags so it cannot be safe-loaded; its only change is one deleted blank line, andmkdocs build --strictstill passespixi.lock and .gitattributes
pixi.lockis 438K of lockfile with nopixi.tomland no[tool.pixi]section anywhere — orphaned since the move to uv in November 2025..gitattributesexisted only to mark it generated, duplicated across two identical lines:Rather than delete it, it now does the same for
uv.lock, which collapses that file in GitHub diffs and keeps it out of language stats. Every dependency PR in this repo buries its real change under hundreds of lock lines; this fixes that.Verification
All six hooks pass on
--all-files.black --check,ruff check, anduv lock --checkare clean afterwards — the round-trip that was previously broken.