Repository navigation
🔧 build(lint): adopt simplint 0.8.0 - #308
Merged
Merged
Conversation
Ruff's D1xx rules and simplint's function-docstring disagree on the docstrings of internal functions, so simplint refuses to run until the undocumented-public-* rules are ignored; SMP903 documents the public API.
Applied with simplint check --fix --unsafe-fixes, then the formatters through prek.
simplint requires a type on Final and a reason after every suppression code, so the reason states why the rule is bypassed.
The TOML loader returned a three-field tuple, and the env-file loader sat past the complexity limit. Actions are now always collected, so the loaders drop their None checks; only the verbose header reads them.
The project depends on pytest-mock, so tests use its fixture instead of unittest.mock.
Each case lists the files it writes, so the tests no longer branch on which files exist. Rows that were unnamed get ids, and the discovery tests take the section and fallback name from the row.
Each helper follows the function that first calls it, as simplint's definition-before-use rule reads it. The TOML classes and the type alias move up with the constant.
simplint treats the public names of a pytest11 module as API, so the hooks and Entry are listed.
The expected PYTHONPATH and PYTHONDONTWRITEBYTECODE values came from the outer process. The test now clears the environment and passes each case its values, so every expectation is a constant.
The autofix made Entry frozen and keyword-only, which broke code that builds it with positional fields. Entry is in __all__ now, so its signature is public and goes back to the original plain dataclass; simplint reports nothing for it.
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.
simplint checks conventions that Ruff cannot, such as reST docstrings on the public API,
Finalconstants, frozen keyword-only dataclasses, definition order, and reasons on suppressions. This change runs it in pre-commit at v0.8.0 and edits the code so simplint reports nothing, which makes these rules hold on every change instead of only in review. Users of the plugin see no change to the names or signatures they import.Lint configuration
Ruff's
undocumented-*rules are off, because simplint'sundocumented-public-apirule (SMP903) asks for docstrings only on the names the package exports. Hooks also get explicit prekprioritytiers. prek runs lower numbers first and runs hooks that share a number concurrently, so the tiers keep hooks that write the same file apart.Module layout
Each helper now follows the first function that calls it. The plugin hooks and
Entryare listed in__all__, since simplint treats the public names of a plugin module as its API. The TOML loader returns a named result instead of a three-item tuple, and the env-file loader is split so each function does one job. The loaders record the actions they take, and only the verbose header reads that record.Typing and suppressions
Module constants and the TOML value alias have explicit types. Each suppression comment says why the rule is bypassed, and the internal TOML result is a frozen, keyword-only dataclass. Repeated checks are parametrized with named ids, and patching goes through the
mockerfixture from pytest-mock, which the project already depends on.Importable names
The hooks and
Entrykeep their signatures. An autofix had madeEntryfrozen and keyword-only, which broke positional construction, so that change was reverted. The names that moved or changed are all private:_env_actions_keyis now_ENV_ACTIONS_KEY,_apply_entriesis folded into the load hook,_apply_env_filesrequiresactionsandskip_if_set, and_load_toml_configreturns a_TomlConfiginstead of a tuple.Hook source
The hook pins the v0.8.0 release of simplint through simplint-pre-commit.