Skip to content

🔧 build(lint): adopt simplint 0.8.0 - #214

Merged
gaborbernat merged 7 commits into
tox-dev:mainfrom
gaborbernat:simplint
Nov 8, 2026
Merged

gaborbernat merged 7 commits into
tox-dev:mainfrom
gaborbernat:simplint

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

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 importing pre_commit_uv runs no code. The startup patch moved to a private module that the .pth file imports. Only the patch's own internals changed name: _patch, _new_main, _is_calling_pre_commit, _health_check and _version_info are no longer importable from pre_commit_uv and live in pre_commit_uv._pre_commit_patch, and _original_main became _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's undocumented-public-api covers 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 Final and named in upper case, the autofixer's version constants got descriptive names, and every ruff and ty suppression states why it is needed.

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.
@gaborbernat gaborbernat added enhancement New feature or request skip news No user-facing changelog entry is needed labels Nov 8, 2026
@gaborbernat
gaborbernat merged commit fbdd9ce into tox-dev:main Nov 8, 2026
23 checks passed
@gaborbernat
gaborbernat deleted the simplint branch November 16, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request skip news No user-facing changelog entry is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant