Full changelog¶
What's New in Pylint 2.4.4?¶
Release date: 2019-11-13
Exempt all the names found in type annotations from
unused-importThe previous code was assuming that only
typingnames need to be exempted, but we need to do that for the rest of the type comment names as well.Closes #3112
Relax type import detection for names that do not come from the
typingmoduleCloses #3191
What's New in Pylint 2.4.3?¶
Release date: 2019-10-18
Fix an issue with
unnecessary-comprehensionin comprehensions with additional repacking of elements.Closes #3148
import-outside-toplevelis emitted forImportFromnodes as well.Closes #3175
Do not emit
no-method-argumentfor functions using positional only args.Closes #3161
consider-using-sys-exitis no longer emitted whenexitis imported in the local scope.Closes #3147
invalid-overridden-methodtakesabc.abstractpropertyin accountCloses #3150
Fixed
missing-yield-type-docgetting incorrectly raised when a generator does not document a yield type but has a type annotation.Closes #3185
typing.overloadfunctions are exempted fromtoo-many-function-argsCloses #3170
What's New in Pylint 2.4.2?¶
Release date: 2019-09-30
ignored-modulescan skip submodules.Closes #3135
self-assigning-variableskips class level assignments.Closes #2930
consider-using-sys-exitis exempted whenexit()is imported fromsysCloses #3145
Exempt annotated assignments without variable from
class-variable-slots-conflictCloses #3141
Fix
utils.is_errorto account for functions returning early.This fixes a false negative with
unused-variablewhich was no longer triggered when a function raised an exception as the last instruction, but the body of the function still had unused variables.Closes #3028
What's New in Pylint 2.4.1?¶
Release date: 2019-09-25
Exempt type checking definitions defined in both clauses of a type checking guard
Closes #3127
Exempt type checking definitions inside the type check guard
In a7f236528bb3758886b97285a56f3f9ce5b13a99 we added basic support for emitting
used-before-assignmentif a variable was only defined inside a type checking guard (usingTYPE_CHECKINGvariable from typing) Unfortunately that missed the case of using those type checking imports inside the guard itself, which triggered spurious used-before-assignment errors.Closes #3119
Require astroid >= 2.3 to avoid any compatibility issues.
What's New in Pylint 2.4.0?¶
Release date: 2019-09-24
New check:
import-outside-toplevelThis check warns when modules are imported from places other than a module toplevel, e.g. inside a function or a class.
Handle inference ambiguity for
invalid-format-indexCloses #2752
Removed Python 2 specific checks such as
relative-import,invalid-encoded-data,missing-super-argument.Support forward references for
function-redefinedcheck.Closes #2540
Handle redefinitions in case of type checking imports.
Closes #2834
Added a new check,
consider-using-sys-exitThis check is emitted when we detect that a quit() or exit() is invoked instead of sys.exit(), which is the preferred way of exiting in program.
Closes #2925
useless-suppressioncheck now ignorescyclic-importsuppressions, which could lead to false postiives due to incomplete context at the time of the check.Closes #3064
Added new checks,
no-else-breakandno-else-continueThese checks highlight unnecessary
elseandelifblocks afterbreakandcontinuestatements.Closes #2327
Don't emit
protected-accesswhen a single underscore prefixed attribute is used inside a special methodCloses #1802
Fix the "statement" values in the PyLinter's stats reports by module.
Added a new check,
invalid-overridden-methodThis check is emitted when we detect that a method is overridden as a property or a property is overridden as a method. This can indicate a bug in the application code that will trigger a runtime error.
Closes #2670
Added a new check,
arguments-out-of-orderThis check warns if you have arguments with names that match those in a function's signature but you are passing them in to the function in a different order.
Closes #2975
Added a new check,
redeclared-assigned-nameThis check is emitted when
pylintdetects that a name was assigned one or multiple times in the same assignment, which indicate a potential bug.Closes #2898
Ignore lambda calls with variadic arguments without a context.
Inferring variadic positional arguments and keyword arguments will result into empty Tuples and Dicts, which can lead in some cases to false positives with regard to no-value-for-parameter. In order to avoid this, until we'll have support for call context propagation, we're ignoring such cases if detected. We already did that for function calls, but the previous fix was not taking in consideration
lambdasCloses #2918
Added a new check,
self-assigning-variable. This check is emitted when we detect that a variable is assigned to itself, which might indicate a potential bug in the code application.Closes #2930
Added a new check,
property-with-parameters.This check is emitted when we detect that a defined property also has parameters, which are useless.
Closes #3006
Excluded protocol classes from a couple of checks.
Closes #3002.
Add a check
unnecessary-comprehensionthat detects unnecessary comprehensions.This check is emitted when
pylintfinds list-, set- or dict-comprehensions, that are unnecessary and can be rewritten with the list-, set- or dict-constructors.Closes #2905
Excluded PEP 526 instance and class variables from
no-member.Closes #2945
Excluded
attrsfromtoo-few-public-methodscheck.Closes #2988.
unused-importemitted for the right import names in function scopes.Closes #2928
Dropped support for Python 3.4.
assignment-from-no-returnnot triggered for async methods.Closes #2902
Don't emit
attribute-defined-outside-initfor variables defined in setters.Closes #409
Syntax errors report the column number.
Closes #2914
Support fully qualified typing imports for type annotations.
Closes #2915
Exclude
__dict__fromattribute-defined-outside-initFix pointer on spelling check when the error are more than one time in the same line.
Closes #2895
Fix crash happening when parent of called object cannot be determined
Allow of in
GoogleDocstring.re_multiple_typeAdded
subprocess-run-checkto handle subrocess.run without explicitly setcheckkeyword.Closes #2848
When we can't infer bare except handlers, skip
try-except-raiseCloses #2853
Handle more
unnecessary-lambdacases when dealing with additional kwargs in wrapped callsCloses #2845
Better postponed evaluation of annotations handling
Closes #2847
Support postponed evaluation of annotations for variable annotations.
Closes #2838
epylint.py_rundefaults topythonin case the current executable is not a Python one.Closes #2837
Ignore raw docstrings when running Similarities checker with
ignore-docstrings=yesoptionFix crash when calling
inherit_from_std_exon a class which is its own ancestorCloses #2680
Added a new check that warns the user if a function call is used inside a test but parentheses are missing.
Closes #2658
len-as-conditionnow only fires when alen(x)call is made without an explicit comparisonThe message and description accompanying this checker has been changed reflect this new behavior, by explicitly asking to either rely on the fact that empty sequence are false or to compare the length with a scalar.
Closes #2684
Add
preferred-modulechecker that notify if an import has a replacement module that should be used.This check is emitted when
pylintfinds an imported module that has a preferred replacement listed inpreferred-modules.assigning-non-slotnot emitted for classes with unknown base classes.Closes #2807
old-divisionis not emitted for non-Const nodes.Closes #2808
Added method arguments to the dot writer for pyreverse.
Closes #2139
Support for linting file from stdin.
IDEs may benefit from the support for linting from an in-memory file.
Closes #1187
Added a new check
class-variable-slots-conflictThis check is emitted when
pylintfinds a class variable that conflicts with a slot name, which would raise aValueErrorat runtime.Added new check: dict-iter-missing-items (E1141)
Closes #2761
Fix issue with pylint name in output of python -m pylint --version
Closes #2764
Relicense logo material under the CC BY-SA 4.0 license.
Skip
ifexpressions from f-strings for thecheck_elifcheckerCloses #2816
C0412 (ungrouped-import) is now compatible with isort.
Closes #2806
Added new extension to detect too much code in a try clause
Closes #2877
signature-mutatorsoption was added. With this option, users can choose to ignoretoo-many-function-args,unexpected-keyword-arg, andno-value-for-parameterfor functions decorated with decorators that change the signature of a decorated function.Closes #259
Fixed a pragma comment on its own physical line being ignored when part of a logical line with the previous physical line.
Closes #199
Fixed false
undefined-loop-variablefor a function defined in the loop, that uses the variable defined in that loop.Closes #202
Fixed
unused-argumentandfunction-redefinedgetting raised for functions decorated withtyping.overload.Closes #1581
Fixed a false positive with
consider-using-dict-comprehensionfor constructions that can't be converted to a comprehensionCloses #2963
Added
__post_init__todefining-attr-methodsin order to avoidattribute-defined-outside-initin dataclasses.Closes #2581
Changed description of W0199 to use the term 2-item-tuple instead of 2-uple.
Allow a
.as a prefix for Sphinx name resolution.Checkers must now keep a 1 to 1 relationship between "msgid" (ie: C1234) and "symbol" (i.e. : human-readable-symbol)
In checkers, an old_names can now be used for multiple new messages and pylint is now a little faster
It means if you do a partial old_names for a message definition an exception will tell you that you must rename the associated identification.
Allow the choice of f-strings as a valid way of formatting logging strings.
Closes #2395
Added
--list-msgs-enabledcommand to list all enabled and disabled messages given the current RC file and command line arguments.