What's New in Pylint 2.10¶
Summary -- Release highlights¶
In 2.10, we added several new default check, like
use-dict-literal. There's also a few opinionated optional one. You can now forbid while loop or
profess your exclusive love of ternary expressions publicly. We promise you hours of arguing fun with
your whole team if you add those to your configuration.
We've also fixed some long standing bugs, false positives, or missing options like
will now work on inner function's signatures.
A new option to disable the next line,
disable-next, has been added. It's also possible to export
colored diagrams, and plantuml diagram using pyreverse.
PYLINT_HOME is now
XDG_CACHE_HOME if not set.
The performance of the similarity checker has been improved, as well as several small performance fixes.
We're going to continue working on improving performance during 2.11. We're also going to finalize
possible-forgotten-f-prefix check that had too much false positives at release time.
Check the possible-forgotten-f-prefix issue if you want to provide knowledge or use case :)
unspecified-encoding: Emitted when open() is called without specifying an encoding
use-list-literal: Emitted when
list()is called with no arguments instead of using
use-dict-literal: Emitted when
dict()is called with no arguments instead of using
forgotten-debug-statement: Emitted when
sys.breakpointhookcalls are found
use-sequence-for-iteration: Emitted when iterating over an in-place defined
format-string-without-interpolationchecker: Emitted when formatting is applied to a string without any variables to be replaced
redundant-u-string-prefixchecker: Emitted when the u prefix is added to a string
consider-using-tupleto be emitted only for in-place defined
consider-using-tupleeven if list contains a
Added optional extension
consider-ternary-expression: Emitted whenever a variable is assigned in both branches of an if/else block.
Closes # 4366
Added optional extension
while-used: Emitted whenever a
whileloop is used.
Closes # 4367
pyreverse now permit to produce colored generated diagram by using the
Pyreverse - add output in PlantUML format
consider-using-withis no longer triggered if a context manager is returned from a function.
pylint does not crash with a traceback anymore when a file is problematic. It creates a template text file for opening an issue on the bug tracker instead. The linting can go on for other non problematic files instead of being impossible.
Pyreverse - Show class has-a relationships inferred from type-hints
Performance of the Similarity checker has been improved.
time.clockto deprecated functions/methods for python 3.3
ignored-parentsoption to the design checker to ignore specific classes from the
no-membererror if guarded behind if statement.
Ref #1162 Closes #1990 Closes #4168
Fix false positives for
superfluous-parenswith walrus operator, ternary operator and inside list comprehension.
Closes #2818 Closes #3249 Closes #3608 Closes #4346
--list-msgs-enabled: both options now show whether messages are emittable with the current interpreter.
Fix false negative for
used-before-assignmentwhen the variable is assigned in an exception handler, but used outside of the handler.
disable-nextoption: allows using # pylint: disable-next=msgid to disable a message for the following line
cell-var-from-loopchecker: handle cell variables in comprehensions within functions, and function default argument expressions. Also handle basic variable shadowing.
Closes #2846 Closes #3107
Fixed bug with
cell-var-from-loopchecker: it no longer has false negatives when both
Class methods' signatures are now ignored the same way as functions' with similarities "ignore-signatures" option enabled