Releases: pylint-dev/pylint
v2.15.7
v2.15.6
False Positives Fixed
-
Fix false positive for
unhashable-memberwhen subclassingdictand
using the subclass as a dictionary key.Closes #7501
-
unnecessary-list-index-lookupwill not be wrongly emitted if
enumerateis called withstart.Closes #7682
-
Don't warn about
stop-iteration-returnwhen usingnext()over
itertools.cycle.Closes #7765
Other Bug Fixes
-
Messages sent to reporter are now copied so a reporter cannot modify the
message sent to other reporters.Closes #7214
-
Fixes edge case of custom method named
nextraised an astroid error.Closes #7610
-
Fix crash that happened when parsing files with unexpected encoding starting
with 'utf' likeutf13.Closes #7661
-
Fix a crash when a child class with an
__init__method inherits from a
parent class with an__init__class attribute.Closes #7742
v2.15.5
What's new in Pylint 2.15.5?
Release date: 2022-10-21
False Positives Fixed
-
Fix a false positive for
simplify-boolean-expressionwhen multiple values
are inferred for a constant.Closes #7626
Other Bug Fixes
-
Remove
__index__dunder method call fromunnecessary-dunder-call
check.Closes #6795
-
Fixed a multi-processing crash that prevents using any more than 1 thread on
MacOS.The returned module objects and errors that were cached by the linter plugin loader cannot be reliably pickled. This means that
dillwould throw an error when attempting to serialise the linter object for multi-processing use.Closes #7635.
Other Changes
v2.15.4
False Positives Fixed
-
Fix the message for
unnecessary-dunder-callfor__aiter__and
__anext__. Also
only emit the warning whenpy-version>= 3.10.Closes #7529
Other Bug Fixes
-
Fix bug in detecting
unused-variablewhen iterating on variable.Closes #3044
-
Fixed handling of
--as separator between positional arguments and flags.
This was not actually fixed in 2.14.5. -
Report
no-self-argumentrather thanno-method-argumentfor methods
with variadic arguments.Closes #7507
-
Fixed an issue where
syntax-errorcouldn't be raised on files with
invalid encodings.Closes #7522
-
Fix false positive for
redefined-outer-namewhen aliasingtyping
e.g. astand guarding imports undert.TYPE_CHECKING.Closes #7524
-
Fixed a crash of the
modified_iteratingchecker when iterating on a set
defined as a class attribute.Closes #7528
-
Fix bug in scanning of names inside arguments to
typing.Literal.
See https://peps.python.org/pep-0586/#literals-enums-and-forward-references
for details.Refs #3299
Other Changes
-
Add method name to the error messages of
no-method-argumentand
no-self-argument.Closes #7507
v2.15.3
-
Fixed a crash in the
unhashable-memberchecker when using alambdaas a dict key.Closes #7453
-
Fix a crash in the
modified-iterating-dictchecker involving instance attributes.Closes #7461
-
invalid-class-objectdoes not crash anymore when__class__is assigned alongside another variable.Closes #7467
-
Fix false positive for
global-variable-not-assignedwhen a global variable is re-assigned via anImportFromnode.Closes #4809
-
Fix false positive for
undefined-loop-variableinfor-elseloops that use a function
having a return type annotation ofNoReturnorNever.Closes #7311
-
--help-msgnow accepts a comma-separated list of message IDs again.Closes #7471
v2.15.2
-
Fixed a case where custom plugins specified by command line could silently fail.
Specifically, if a plugin relies on the
init-hookoption changingsys.pathbefore
it can be imported, this will now emit abad-plugin-valuemessage. Before this
change, it would silently fail to register the plugin for use, but would load
any configuration, which could have unintended effects.Fixes part of #7264.
-
Fix
used-before-assignmentfor functions/classes defined in type checking guard.Closes #7368
-
Update
modified_iteratingchecker to fix a crash withforloops on empty list.Closes #7380
-
The
docparamsextension now considers typing in Numpy style docstrings
as "documentation" for themissing-param-docmessage.Refs #7398
-
Fix false positive for
unused-variableandunused-importwhen a name is only used in a string literal type annotation.Closes #3299
-
Fix false positive for
too-many-function-argswhen a function call is assigned to a class attribute inside the class where the function is defined.Closes #6592
-
Fix
used-before-assignmentfor functions/classes defined in type checking guard.Closes #7368
-
Fix ignored files being linted when passed on stdin.
Closes #4354
-
missing-return-doc,missing-raises-docandmissing-yields-docnow respect
theno-docstring-rgxoption.Closes #4743
-
Don't crash on
OSErrorin config file discovery.Closes #7169
-
disable-nextis now correctly scoped to only the succeeding line.Closes #7401
-
Update
modified_iteratingchecker to fix a crash withforloops on empty list.Closes #7380
v2.15.1
-
Fix
used-before-assignmentfor functions/classes defined in type checking guard.Closes #7368
-
Update
modified_iteratingchecker to fix a crash withforloops on empty list.Closes #7380
-
The
docparamsextension now considers typing in Numpy style docstrings
as "documentation" for themissing-param-docmessage.Refs #7398
-
Fix false positive for
unused-variableandunused-importwhen a name is only used in a string literal type annotation.Closes #3299
-
Fix false positive for
too-many-function-argswhen a function call is assigned to a class attribute inside the class where the function is defined.Closes #6592
-
Fix
used-before-assignmentfor functions/classes defined in type checking guard.Closes #7368
-
Fix ignored files being linted when passed on stdin.
Closes #4354
-
missing-return-doc,missing-raises-docandmissing-yields-docnow respect
theno-docstring-rgxoption.Closes #4743
-
Don't crash on
OSErrorin config file discovery.Closes #7169
-
disable-nextis now correctly scoped to only the succeeding line.Closes #7401
-
Update
modified_iteratingchecker to fix a crash withforloops on empty list.Closes #7380
v2.15.0
In pylint 2.15.0, we added a new check missing-timeout to warn of default timeout values that could cause a program to be hanging indefinitely.
We improved pylint's handling of namespace packages. More packages should be linted without resorting to using the --recursive=y option.
We still welcome any community effort to help review, integrate, and add good/bad examples to the doc for #5953. This should be doable without any pylint or astroid knowledge, so this is the perfect entrypoint if you want to contribute to pylint or open source without any experience with our code!
Internally, we changed the way we generate the release notes, thanks to DudeNr33. There will be no more conflict resolution to do in the changelog, and every contributor rejoice.
Marc Byrne became a maintainer, welcome to the team !
New Checks
-
Added new checker
missing-timeoutto warn of default timeout values that could cause
a program to be hanging indefinitely.Refs #6780
False Positives Fixed
-
Don't report
super-init-not-calledfor abstract__init__methods.Closes #3975
-
Don't report
unsupported-binary-operationon Python <= 3.9 when using the|operator
with types, if one has a metaclass that overloads__or__or__ror__as appropriate.Closes #4951
-
Don't report
no-value-for-parameterfor dataclasses fields annotated withKW_ONLY.Closes #5767
-
Fixed inference of
Enumswhen they are imported under an alias.Closes #5776
-
Prevent false positives when accessing
PurePath.parentsby index (not slice) on Python 3.10+.Closes #5832
-
unnecessary-list-index-lookupis now more conservative to avoid potential false positives.Closes #6896
-
Fix double emitting
trailing-whitespacefor multi-line docstrings.Closes #6936
-
import-errornow correctly checks forcontextlib.suppressguards on import statements.Closes #7270
-
Fix false positive for
no-self-argument/no-method-argumentwhen a staticmethod is applied to a function but uses a different name.Closes #7300
-
Fix
undefined-loop-variablewithbreakandcontinuestatements inelseblocks.Refs #7311
False Negatives Fixed
-
Emit
used-before-assignmentwhen relying on a name that is reimported later in a function.Closes #4624
-
Emit
used-before-assignmentfor self-referencing named expressions (:=) lacking
prior assignments.Closes #5653
-
Emit
used-before-assignmentfor self-referencing assignments under if conditions.Closes #6643
-
Emit
modified-iterating-listand analogous messages for dicts and sets when iterating
literals, or when using thedelkeyword.Closes #6648
-
Emit
used-before-assignmentwhen calling nested functions before assignment.Closes #6812
-
Emit
nonlocal-without-bindingwhen a nonlocal name has been assigned at a later point in the same scope.Closes #6883
-
Emit
using-constant-testwhen testing the truth value of a variable or call result
holding a generator.Closes #6909
-
Rename
unhashable-dict-keytounhashable-memberand emit when creating sets and dicts,
not just when accessing dicts.
Other Bug Fixes
-
Fix a failure to lint packages with
__init__.pycontained in directories lacking__init__.py.Closes #1667
-
Fixed a syntax-error crash that was not handled properly when the declared encoding of a file
wasutf-9.Closes #3860
-
Fix a crash in the
not-callablecheck when there is ambiguity whether an instance is being incorrectly provided to__new__().Closes #7109
-
Fix crash when regex option raises a
re.errorexception.Closes #7202
-
Fix
undefined-loop-variablefrom walrus in comprehension test.Closes #7222
-
Check for
<cwd>before removing first item fromsys.pathinmodify_sys_path.Closes #7231
-
Fix sys.path pollution in parallel mode.
Closes #7246
-
Prevent
useless-parent-delegationfor delegating to a builtin
written in C (e.g.Exception.__init__) with non-self arguments.Closes #7319
Other Changes
-
bad-exception-contexthas been renamed tobad-exception-causeas it is about the cause and not the context.Closes #3694
-
The message for
literal-comparisonis now more explicit about the problem and the
solution.Closes #5237
-
useless-super-delegationhas been renamed touseless-parent-delegationin order to be more generic.Closes #6953
-
Pylint now uses
towncrierfor changelog generation.Refs #6974
-
Update
astroidto 2.12.Refs #7153
-
Fix crash when a type-annotated
__slots__with no value is declared.Closes #7280
Internal Changes
-
Fixed an issue where it was impossible to update functional tests output when the existing
output was impossible to parse. Instead of raising an error we raise a warning message and
let the functional test fail with a default value.Refs #6891
-
pylint.testutils.primeris now a private API.Refs #6905
-
We changed the way we handle the changelog internally by using towncrier.
If you're a contributor you won't have to fix merge conflicts in the
changelog anymore.Closes #6974
-
Pylint is now using Scorecards to implement security recommendations from the
OpenSSF <https://openssf.org/>_. This is done in order to secure our supply chains using a combination
of automated tooling and best practices, most of which were already implemented before.Refs #7267
v2.14.5
-
Fixed a crash in the
undefined-loop-variablecheck whenenumerate()is used
in a ternary expression.Closes #7131
-
Fixed handling of
--as separator between positional arguments and flags.Closes #7003
-
Fixed the disabling of
fixmeand its interaction withuseless-suppression. -
Allow lists of default values in parameter documentation for
Numpystyle.Closes #4035
v2.14.4
-
The
differing-param-doccheck was triggered by positional only arguments.Closes #6950
-
Fixed an issue where scanning
.directory recursively with--ignore-path=^path/to/diris not
ignoring thepath/to/dirdirectory.Closes #6964
-
Fixed regression that didn't allow quoted
init-hooksin option files.Closes #7006
-
Fixed a false positive for
modified-iterating-dictwhen updating an existing key.Closes #6179
-
Fixed an issue where many-core Windows machines (>~60 logical processors) would hang when
using the default jobs count.Closes #6965
-
Fixed an issue with the recognition of
setup.cfgfiles.
Only.cfgfiles that are exactly namedsetup.cfgrequire section names that
start withpylint..Closes #3630
-
Don't report
import-private-namefor relative imports.Closes #7078