MNT: Apply Repo-Review suggestions #1288
Merged
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.
Apply some Repo-Review suggestions.
I went for the low-hanging fruits, other changes are more invasive and deserve a PR of their own, such as using a formatter like ruff of black.
Also update minimal Python version for blue. By the way, isn't blue able to understand
requires-python
?Fixed issues
Must have
warn_unreachable = true
to pass this check. There are occasionally false positives (often due to platform or Python version static checks), so it's okay to ignore this check. But try it first - it can catch real bugs too.Must have
"ignore-without-code"
inenable_error_code = [...]
. This will force all skips in your project to include the error code, which makes them more readable, and avoids skipping something unintended.Must have
"redundant-expr"
inenable_error_code = [...]
. This helps catch useless lines of code, like checking the same condition twice.Must have
"truthy-bool"
inenable_error_code = []
. This catches mistakes in using a value as truthy if it cannot be falsey.Issues ignored
Left for later because it requires extensive fixes:
Must have
strict
in the mypy config. MyPy is best with strict or nearly strict configuration. If you are happy with the strictness of your settings already, ignore this check or setstrict = false
explicitly.