What's New in Pylint 2.17¶
- Release:
2.17
- Date:
2023-03-08
Summary -- Release highlights¶
2.17 is a small release that is the first to support python 3.11 officially with the addition of TryStar nodes.
There's still two new default checks: bad-chained-comparison and
implicit-flag-alias, one of them already fixed a previously
undetected bug in sentry.
Thanks to the community effort our documentation is almost complete, and every messages should have a proper documentation now. A big thank you to everyone who participated !
The next release is going to be 3.0.0, bring breaking changes and enact long
announced deprecations. There's going to be frequent beta releases,
before the official releases, everyone is welcome to try the betas
so we find problems before the actual release.
What's new in Pylint 2.17.4?¶
Release date: 2023-05-06
False Positives Fixed¶
Fix a false positive for
bad-dunder-namewhen there is a user-defined__index__method.Closes #8613 (#8613)
Other Bug Fixes¶
pyreverse: added escaping of vertical bar character in annotation labels produced by DOT printer to ensure it is not treated as field separator of record-based nodes.Closes #8603 (#8603)
Fixed a crash when generating a configuration file:
tomlkit.exceptions.TOMLKitError: Can't add a table to a dotted keycaused by tomlkitv0.11.8.Closes #8632 (#8632)
What's new in Pylint 2.17.3?¶
Release date: 2023-04-24
False Positives Fixed¶
Fix unused-argument false positive when __new__ does not use all the arguments of __init__.
Closes #3670 (#3670)
Fix
unused-importfalse positive for usage ofsix.with_metaclass.Closes #7506 (#7506)
logging-not-lazy is not longer emitted for explicitly concatenated string arguments.
Closes #8410 (#8410)
Fix false positive for isinstance-second-argument-not-valid-type when union types contains None.
Closes #8424 (#8424)
Fixed unused-import so that it observes the dummy-variables-rgx option.
Closes #8500 (#8500)
Union typed variables without assignment are no longer treated as TypeAlias.
Closes #8540 (#8540)
Fix false positive for
positional-only-arguments-expectedwhen a function contains both a positional-only parameter that has a default value, and**kwargs.Closes #8555 (#8555)
Fix false positive for
keyword-arg-before-varargwhen a positional-only parameter with a default value precedes*args.Closes #8570 (#8570)
Other Bug Fixes¶
Improve output of
consider-using-generatormessage formin()` calls with ``defaultkeyword.Closes #8563 (#8563)
What's new in Pylint 2.17.2?¶
Release date: 2023-04-03
False Positives Fixed¶
invalid-namenow allows for integers intypealiasnames: - now valid:Good2Name,GoodName2. - still invalid:_1BadName.Closes #8485 (#8485)
No longer consider
Unionas type annotation as type alias for naming checks.Closes #8487 (#8487)
unnecessary-lambdano longer warns on lambdas which use its parameters in their body (other than the final arguments), e.g.lambda foo: (bar if foo else baz)(foo).Closes #8496 (#8496)
Other Bug Fixes¶
Fix a crash in pyreverse when "/" characters are used in the output filename e.g pyreverse -o png -p name/ path/to/project.
Closes #8504 (#8504)
What's new in Pylint 2.17.1?¶
Release date: 2023-03-22
False Positives Fixed¶
Adds
asyncSetUpto the defaultdefining-attr-methodslist to silenceattribute-defined-outside-initwarning when usingunittest.IsolatedAsyncioTestCase.Refs #8403 (#8403)
Other Bug Fixes¶
--clear-cache-post-runnow also clears LRU caches for pylint utilities holding references to AST nodes.Closes #8361 (#8361)
Fix a crash when
TYPE_CHECKINGis used without importing it.Closes #8434 (#8434)
Fix a regression of
preferred-moduleswhere a partial match was used instead of the required full match.Closes #8453 (#8453)
Internal Changes¶
The following utilities are deprecated in favor of the more robust
in_type_checking_blockand will be removed in pylint 3.0:is_node_in_guarded_import_blockis_node_in_typing_guarded_import_blockis_typing_guard
is_sys_guardis still available, which was part ofis_node_in_guarded_import_block.Refs #8433 (#8433)
What's new in Pylint 2.17.0?¶
Release date: 2023-03-08
New Features¶
pyreverse now supports custom color palettes with the --color-palette option.
Closes #6738 (#6738)
Add
invalid-namecheck forTypeAliasnames.Closes #7081. (#7081)
Accept values of the form
<class name>.<attribute name>for theexclude-protectedlist.Closes #7343 (#7343)
Add --version option to pyreverse.
Refs #7851 (#7851)
Adds new functionality with preferred-modules configuration to detect submodules.
Refs #7957 (#7957)
Support implicit namespace packages (PEP 420).
Closes #8154 (#8154)
Add globbing pattern support for
--source-roots.Closes #8290 (#8290)
Support globbing pattern when defining which file/directory/module to lint.
Closes #8310 (#8310)
pylint now supports
TryStarnodes from Python 3.11 and should be fully compatible with Python 3.11.Closes #8387 (#8387)
New Checks¶
Add a
bad-chained-comparisoncheck that emits a warning when there is a chained comparison where one expression is semantically incompatible with the other.Closes #6559 (#6559)
Adds an
implicit-flag-aliascheck that emits a warning when a class derived fromenum.IntFlagassigns distinct integer values that share common bit positions.Refs #8102 (#8102)
False Positives Fixed¶
Fix various false positives for functions that return directly from structural pattern matching cases.
Closes #5288 (#5288)
Fix false positive for
used-before-assignmentwhentyping.TYPE_CHECKINGis used with if/elif/else blocks.Closes #7574 (#7574)
Fix false positive for isinstance-second-argument-not-valid-type with union types.
Closes #8205 (#8205)
Fix false positive for
used-before-assignmentfor named expressions appearing after the first element in a list, tuple, or set.Closes #8252 (#8252)
Fix false positive for
wrong-spelling-in-commentwith class names in a python 2 type comment.Closes #8370 (#8370)
False Negatives Fixed¶
Other Bug Fixes¶
Fix
used-before-assignmentfalse positive when the walrus operator is used with a ternary operator in dictionary key/value initialization.Closes #8125 (#8125)
Fix
no-name-in-modulefalse positive raised when a package defines a variable with the same name as one of its submodules.Closes #8148 (#8148)
Fix a crash happening for python interpreter < 3.9 following a failed typing update.
Closes #8161 (#8161)
Fix
nested-min-maxsuggestion message to indicate it's possible to splat iterable objects.Closes #8168 (#8168)
Fix a crash happening when a class attribute was negated in the start argument of an enumerate.
Closes #8207 (#8207)
Prevent emitting
invalid-namefor the line on which aglobalstatement is declared.Closes #8307 (#8307)