Repository navigation
🔧 build(lint): adopt simplint 0.8.0 - #214
Merged
Merged
Conversation
Applied with simplint --fix --unsafe-fixes, then the formatters via prek.
The patch moves to _pre_commit_patch so the package __init__ holds no code. The .pth file calls the patch from its new module, so it still runs at interpreter startup.
These names are never reassigned, so they are constants: annotate them Final and name them in upper case, matching the rest of the test module.
Importing the patch does not apply it, so the per-test imports only existed to be suppressed.
Each ruff and ty directive now states why it is needed, so the next reader does not have to rediscover it.
The autofix uppercased the version constants to _SELF and _UV, which say nothing about what they hold, and left a blank first line in a test.
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.
Contributors get the project's style conventions checked on every commit, not in review. simplint now runs in the pre-commit hook set and enforces the rules Ruff cannot check, pinned to the released v0.8.0. Users of pre-commit-uv should see no change in behavior, because the startup patch still loads when the interpreter starts. 🔧
The package
__init__now holds only its docstring, so importingpre_commit_uvruns no code. The startup patch moved to a private module that the.pthfile imports. Only the patch's own internals changed name:_patch,_new_main,_is_calling_pre_commit,_health_checkand_version_infoare no longer importable frompre_commit_uvand live inpre_commit_uv._pre_commit_patch, and_original_mainbecame_ORIGINAL_MAIN. No public name or signature changed.Each hook now sets a
priority, the prek hook priority tier: prek runs lower tiers first and runs hooks in the same tier concurrently, so hooks that rewrite the same file sit in different tiers. Ruff lint runs before simplint and Ruff format after it, so simplint checks the code the autofixer produced. pre-commit ignores the key and keeps file order.Ruff's
undocumented-*public rules are off, because they ask for a docstring on every public name. simplint'sundocumented-public-apicovers the public API instead, so docstrings are asked for only where users reach them.The code now follows the rules by topic. Module constants are annotated
Finaland named in upper case, the autofixer's version constants got descriptive names, and every ruff and ty suppression states why it is needed.