Bump pylint to 3.2.1, update changelog #9650
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.
What's new in Pylint 3.2.1?
Release date: 2024-05-18
False Positives Fixed
Exclude if/else branches containing terminating functions (e.g.
sys.exit()
)from
possibly-used-before-assignment
checks.Closes possibly-used-before-assignment doesn't understand never-returning-functions #9627
Don't emit
typevar-name-incorrect-variance
warnings for PEP 695 style TypeVars.The variance is inferred automatically by the type checker.
Adding
_co
or_contra
suffix can help to reason about TypeVar.Refs Don't emit incorrect-variance for type parameters (PEP 695) #9638
Fix a false positive for
possibly-used-before-assignment
when usingtyping.assert_never()
(3.11+) to indicate exhaustiveness.Closes
possibly-used-before-assignment
does not understandassert_never
#9643Other Bug Fixes
Fix a false negative for
--ignore-patterns
when the directory to be linted is specified using a dot(.
) and all files are ignored instead of only the files whose name begin with a dot.Closes
ignore-patterns
incorrectly ignores some files #9273Restore "errors / warnings by module" section to report output (with
-ry
).Closes 'warnings by module' table missing in a report #9145
trailing-comma-tuple
should now be correctly emitted when it was disabled globallybut enabled via local message control, after removal of an over-optimisation.
Refs R1707 (trailing-comma-tuple) checks perform excessive is_message_enabled calls #9608
Add
--prefer-stubs=yes
option to opt-in to the astroid 3.2 featurethat prefers
.pyi
stubs over same-named.py
files. This has thepotential to reduce
no-member
errors but at the cost of more errorssuch as
not-an-iterable
from function bodies appearing as...
.Defaults to
no
.Closes pylint 3.2.0 causes false-positive E1133 (not-an-iterable) error in packages with .pyi stubs #9626
Closes
--ignore-patterns
for.pyi
stubs has no effect if .py resolves to .pyi anyway #9623Internal Changes
Update astroid version to 3.2.1. This solves some reports of
RecursionError
and also makes the prefer .pyi stubs feature in astroid 3.2.0 opt-in
with the aforementioned
--prefer-stubs=y
option.Refs RecursionError escapes during inference #9139