Releases: pylint-dev/pylint
v2.11.0
-
The python3 porting mode checker and it's
py3k
option were removed. You can still find it in older pylint
versions. -
raising-bad-type
is now properly emitted when raising a string -
Added new extension
SetMembershipChecker
withuse-set-for-membership
check:
Emitted when using an in-place definedlist
ortuple
to do a membership test.sets
are better optimized for that.Closes #4776
-
Added
py-version
config key (if[MASTER]
section). Used for version dependant checks.
Will default to whatever Python version pylint is executed with. -
CodeStyleChecker
-
Added
consider-using-assignment-expr
: Emitted when an assignment is directly followed by an if statement
and both can be combined by using an assignment expression:=
. Requires Python 3.8Closes #4862
-
-
Added
consider-using-f-string
: Emitted when .format() or '%' is being used to format a string.Closes #3592
-
Fix false positive for
consider-using-with
if a context manager is assigned to a
variable in different paths of control flow (e. g. if-else clause).Closes #4751
-
https is now prefered in the documentation and http://pylint.pycqa.org correctly redirect to https://pylint.pycqa.org
Closes #3802
-
Fix false positive for
function-redefined
for simple type annotationsCloses #4936
-
Fix false positive for
protected-access
if a protected member is used in type hints of function definitions -
Fix false positive
dict-iter-missing-items
for dictionaries only using tuples as keysCloses #3282
-
The
unspecified-encoding
checker now also checks calls topathlib.Path().read_text()
andpathlib.Path().write_text()
Closes #4945
-
Fix false positive
superfluous-parens
for tuples created with inner tuplesCloses #4907
-
Fix false positive
unused-private-member
for accessing attributes in a class usingcls
Closes #4849
-
Fix false positive
unused-private-member
for private staticmethods accessed in classmethods.Closes #4849
-
Extended
consider-using-in
check to work for attribute access. -
Setting
min-similarity-lines
to 0 now makes the similarty checker stop checking for duplicate codeCloses #4901
-
Fix a bug where pylint complained if the cache's parent directory does not exist
Closes #4900
-
The
global-variable-not-assigned
checker now catches global variables that are never reassigned in a
local scope and catches (reassigned) functions -
Fix false positives for invalid-all-format that are lists or tuples at runtime
Closes #4711
-
Fix
no-self-use
anddocparams extension
for async functions and methods. -
Add documentation for
pyreverse
andsymilar
Closes #4616
-
Non symbolic messages with the wrong capitalisation now correctly trigger
use-symbolic-message-instead
Closes #5000
-
The
consider-iterating-dictionary
checker now also considers membership checksCloses #4069
-
The
invalid-name
message is now more detailed when using multiple naming style regexes.
v2.10.2
v2.10.1
v2.10.0
-
pyreverse: add option to produce colored output.
Closes #4488
-
pyreverse: add output in PlantUML format.
Closes #4498
-
consider-using-with
is no longer triggered if a context manager is returned from a function.Closes #4748
-
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 the type-hint
Closes #4744
-
Fixed a crash when importing beyond the top level package during
import-error
message creationCloses #4775
-
Added
ignored-parents
option to the design checker to ignore specific
classes from thetoo-many-ancestors
check (R0901).Partially closes #3057
-
Added
unspecified-encoding
: Emitted when open() is called without specifying an encodingCloses #3826
-
Improved the Similarity checker performance. Fix issue with
--min-similarity-lines
used with--jobs
. -
Don't emit
no-member
error if guarded behind if statement. -
The default for
PYLINTHOME
is now the standardXDG_CACHE_HOME
, and pylint now usesappdirs
.Closes #3878
-
Added
use-list-literal
: Emitted whenlist()
is called with no arguments instead of using[]
Closes #4365
-
Added
use-dict-literal
: Emitted whendict()
is called with no arguments instead of using{}
Closes #4365
-
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 awhile
loop is used.Closes #4367
-
Added
forgotten-debug-statement
: Emitted whenbreakpoint
,pdb.set_trace
orsys.breakpointhook
calls are foundCloses #3692
-
Fix false-positive of
unused-private-member
when using nested functions in a classCloses #4673
-
Fix crash for
unused-private-member
that occurred with nested attributes.Closes #4755
-
Fix a false positive for
unused-private-member
with class namesCloses #4681
-
Fix false positives for
superfluous-parens
with walrus operator, ternary operator and inside list comprehension. -
Added
format-string-without-interpolation
checker: Emitted when formatting is applied to a string without any variables to be replacedCloses #4042
-
Refactor of
--list-msgs
&--list-msgs-enabled
: both options now show whether messages are emittable with the current interpreter.Closes #4778
-
Fix false negative for
used-before-assignment
when the variable is assigned
in an exception handler, but used outside of the handler.Closes #626
-
Added
disable-next
option: allows using# pylint: disable-next=msgid
to disable a message for the following lineCloses #1682
-
Added
redundant-u-string-prefix
checker: Emitted when the u prefix is added to a stringCloses #4102
-
Fixed
cell-var-from-loop
checker: handle cell variables in comprehensions within functions,
and function default argument expressions. Also handle basic variable shadowing. -
Fixed bug with
cell-var-from-loop
checker: it no longer has false negatives when
bothunused-variable
andused-before-assignment
are disabled. -
Fix false postive for
invalid-all-format
if the list or tuple builtin functions are usedCloses #4711
-
Config files can now contain environment variables
Closes #3839
-
Fix false-positive
used-before-assignment
with an assignment expression in aReturn
nodeCloses #4828
-
Added
use-sequence-for-iteration
: Emitted when iterating over an in-place definedset
. -
CodeStyleChecker
-
Limit
consider-using-tuple
to be emitted only for in-place definedlists
. -
Emit
consider-using-tuple
even if list contains astarred
expression.
-
-
Ignore decorators lines by similarities checker when ignore signatures flag enabled
Closes #4839
-
Allow
true
andfalse
values inpylintrc
for better compatibility withtoml
config. -
Class methods' signatures are ignored the same way as functions' with similarities "ignore-signatures" option enabled
Closes #4653
-
Improve performance when inferring
Call
nodes, by utilizing caching. -
Improve error message for invalid-metaclass when the node is an Instance.
v2.9.6
v2.9.5
-
Fix a crash when there would be a 'TypeError object does not support
item assignment' in the code we parse.Closes #4439
-
Fix crash if a callable returning a context manager was assigned to a list or dict item
Closes #4732
-
Fix a crash when a AttributeInferenceError was not handled properly when
failing to infer the real name of an import in astroid.Closes #4692
v2.9.4
-
Added
time.clock
to deprecated functions/methods for python 3.3 -
Fix bug in which --fail-on can return a zero exit code even when the specified issue is present
-
Fix hard failure when handling missing attribute in a class with duplicated bases
Closes #4687
-
Fix false-positive
consider-using-with
(R1732) if a ternary conditional is used together withwith
Closes #4676
-
Fix false-positive
deprecated-module
when relative import uses deprecated module name.Closes #4629
-
Fix false-positive
consider-using-with
(R1732) ifcontextlib.ExitStack
takes care of calling the__exit__
methodCloses #4654
-
Fix a false positive for
unused-private-member
when mutating a private attribute
withcls
Closes #4657
-
Fix ignored empty functions by similarities checker with "ignore-signatures" option enabled
Closes #4652
-
Fix false-positive of
use-maxsplit-arg
when index is incremented in
a loopCloses #4664
-
Don't emit
cyclic-import
message if import is guarded bytyping.TYPE_CHECKING
.Closes #3525
-
Fix false-positive
not-callable
with alternativeTypedDict
syntaxCloses #4715
-
Clarify documentation for consider-using-from-import
-
Don't emit
unreachable
warning for empty generator functionsCloses #4698
-
Don't emit
import-error
,no-name-in-module
, andungrouped-imports
for imports guarded bysys.version_info
ortyping.TYPE_CHECKING
. -
Fix
invalid-overridden-method
with nested propertyCloses #4368
-
Fix false-positive of
unused-private-member
when using__new__
in a classCloses #4668
-
No longer emit
consider-using-with
forThreadPoolExecutor
andProcessPoolExecutor
as they have legitimate use cases without awith
block.Closes #4689
-
Fix crash when inferring variables assigned in match patterns
Closes #4685
-
Fix a crash when a StopIteration was raised when inferring
a faulty function in a context manager.Closes #4723
v2.9.3
v2.9.2
-
Fix a crash that happened when analysing code using
type(self)
to access
a class attribute in theunused-private-member
checker.Closes #4638
-
Fix a false positive for
unused-private-member
when accessing a private variable
withself
Closes #4644
-
Fix false-positive of
unnecessary-dict-index-lookup
andconsider-using-dict-items
for reassigned dict index lookupsCloses #4630