chore(deps): update dependency pylint to <2.18
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| pylint (changelog) | <2.14 -> <2.18 |
Release Notes
pylint-dev/pylint (pylint)
v2.17.5
What's new in Pylint 2.17.5?
Release date: 2023-07-26
False Positives Fixed
-
Fix a false positive for
unused-variablewhen there is an import in aif TYPE_CHECKING:block andallow-global-unused-variablesis set tonoin the configuration.Closes #β8696
-
Fix false positives generated when supplying arguments as
**kwargsto IO calls like open().Closes #β8719
-
Fix a false positive where pylint was ignoring method calls annotated as
NoReturnduring theinconsistent-return-statementscheck.Closes #β8747
-
Exempt parents with only type annotations from the
invalid-enum-extensionmessage.Closes #β8830
Other Bug Fixes
-
Fixed crash when a call to
super()was placed after an operator (e.g.not).Closes #β8554
-
Fix crash for
modified-while-iteratingchecker when deleting members of a dict returned from a call.Closes #β8598
-
Fix crash in
invalid-metaclasscheck when a metaclass had duplicate bases.Closes #β8698
-
Avoid
consider-using-f-stringon modulos with brackets in template.Closes #β8720.
-
Fix a crash when
__all__exists but cannot be inferred.Closes #β8740
-
Fix crash when a variable is assigned to a class attribute of identical name.
Closes #β8754
-
Fixed a crash when calling
copy.copy()without arguments.Closes #β8774
Other Changes
-
Fix a crash when a
nonlocalis defined at module-level.Closes #β8735
v2.17.4
False Positives Fixed
-
Fix a false positive for
bad-dunder-namewhen there is a user-defined__index__method.Closes #β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
-
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
v2.17.3
What's new in Pylint 2.17.3?
Release date: 2023-04-24
False Positives Fixed
-
Fix
unused-argumentfalse positive when__new__does not use all the arguments of__init__.Closes #β3670
-
Fix
unused-importfalse positive for usage ofsix.with_metaclass.Closes #β7506
-
logging-not-lazyis not longer emitted for explicitly concatenated string arguments.Closes #β8410
-
Fix false positive for isinstance-second-argument-not-valid-type when union types contains None.
Closes #β8424
-
Fixed
unused-importso that it observes thedummy-variables-rgxoption.Closes #β8500
-
Uniontyped variables without assignment are no longer treated asTypeAlias.Closes #β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
-
Fix false positive for
keyword-arg-before-varargwhen a positional-only parameter with a default value precedes*args.Closes #β8570
Other Bug Fixes
-
Improve output of
consider-using-generatormessage formin()` calls withdefault`` keyword.Closes #β8563
v2.17.2
False Positives Fixed
-
invalid-namenow allows for integers intypealiasnames:- now valid:
Good2Name,GoodName2. - still invalid:
_1BadName.
Closes #β8485
- now valid:
-
No longer consider
Unionas type annotation as type alias for naming checks.Closes #β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
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
v2.17.1
False Positives Fixed
-
Adds
asyncSetUpto the defaultdefining-attr-methodslist to silenceattribute-defined-outside-initwarning when usingunittest.IsolatedAsyncioTestCase.Refs #β8403
Other Bug Fixes
-
--clear-cache-post-runnow also clears LRU caches for pylint utilities holding references to AST nodes.Closes #β8361
-
Fix a crash when
TYPE_CHECKINGis used without importing it.Closes #β8434
-
Fix a regression of
preferred-moduleswhere a partial match was used instead of the required full match.Closes #β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
v2.17.0
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 almost all 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.0?
Release date: 2023-03-08
New Features
-
pyreversenow supports custom color palettes with the--color-paletteoption.Closes #β6738
-
Add
invalid-namecheck forTypeAliasnames.Closes #β7081
-
Accept values of the form
<class name>.<attribute name>for theexclude-protectedlist.Closes #β7343
-
Add
--versionoption topyreverse.Refs #β7851
-
Adds new functionality with preferred-modules configuration to detect submodules.
Refs #β7957
-
Support implicit namespace packages (PEP 420).
Closes #β8154
-
Add globbing pattern support for
--source-roots.Closes #β8290
-
Support globbing pattern when defining which file/directory/module to lint.
Closes #β8310
-
pylint now supports
TryStarnodes from Python 3.11 and should be fully compatible with Python 3.11.Closes #β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
-
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
False Positives Fixed
-
Fix various false positives for functions that return directly from structural pattern matching cases.
Closes #β5288
-
Fix false positive for
used-before-assignmentwhentyping.TYPE_CHECKINGis used with if/elif/else blocks.Closes #β7574
-
Fix false positive for isinstance-second-argument-not-valid-type with union types.
Closes #β8205
-
Fix false positive for
used-before-assignmentfor named expressions appearing after the first element in a list, tuple, or set.Closes #β8252
-
Fix false positive for
wrong-spelling-in-commentwith class names in a python 2 type comment.Closes #β8370
False Negatives Fixed
-
Fix a false negative for 'missing-parentheses-for-call-in-test' when inference failed for the internal of the call as we did not need that information to raise correctly.
Refs #β8185
-
Fix false negative for inconsistent-returns with while-loops.
Closes #β8280
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
-
Fix
no-name-in-modulefalse positive raised when a package defines a variable with the same name as one of its submodules.Closes #β8148
-
Fix a crash happening for python interpreter < 3.9 following a failed typing update.
Closes #β8161
-
Fix
nested-min-maxsuggestion message to indicate it's possible to splat iterable objects.Closes #β8168
-
Fix a crash happening when a class attribute was negated in the start argument of an enumerate.
Closes #β8207
-
Prevent emitting
invalid-namefor the line on which aglobalstatement is declared.Closes #β8307
Other Changes
-
Update explanation for
global-variable-not-assignedand add confidence.Closes #β5073
-
The governance model and the path to become a maintainer have been documented as part of our effort to guarantee that the software supply chain in which pylint is included is secure.
Refs #β8329
v2.16.4
False Positives Fixed
-
Fix false positive for isinstance-second-argument-not-valid-type with union types.
Closes #β8205
v2.16.3
False Positives Fixed
-
Fix false positive for
wrong-spelling-in-commentwith class names in a python 2 type comment.Closes #β8370
Other Bug Fixes
-
Prevent emitting
invalid-namefor the line on which aglobalstatement is declared.Closes #β8307
v2.16.2
New Features
-
Add
--versionoption topyreverse.Refs #β7851
False Positives Fixed
-
Fix false positive for
used-before-assignmentwhentyping.TYPE_CHECKINGis used with if/elif/else blocks.Closes #β7574
-
Fix false positive for
used-before-assignmentfor named expressions appearing after the first element in a list, tuple, or set.Closes #β8252
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
-
Fix
no-name-in-modulefalse positive raised when a package defines a variable with the same name as one of its submodules.Closes #β8148
-
Fix
nested-min-maxsuggestion message to indicate it's possible to splat iterable objects.Closes #β8168
-
Fix a crash happening when a class attribute was negated in the start argument of an enumerate.
Closes #β8207
v2.16.1
Other Bug Fixes
-
Fix a crash happening for python interpreter < 3.9 following a failed typing update.
Closes #β8161
v2.16.0
Summary -- Release highlights
In 2.16.0 we added aggregation and composition understanding in pyreverse, and a way to clear
the cache in between run in server mode (originally for the VS Code integration). Apart from the bug
fixes there's also a lot of new checks, and new extensions that have been asked for for a long time
that were implemented.
If you want to benefit from all the new checks load the following plugins::
pylint.extensions.dict_init_mutate,
pylint.extensions.dunder,
pylint.extensions.typing,
pylint.extensions.magic_value,
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!
Last but not least @βclavedeluna and @βnickdrozd became triagers, welcome to the team !
What's new in Pylint 2.16.0?
Changes requiring user actions
-
The
accept-no-raise-docoption related tomissing-raises-docwill now be correctly taken into account all the time.Pylint will no longer raise missing-raises-doc (W9006) when no exceptions are documented and accept-no-raise-doc is true (issue #β7208). If you were expecting missing-raises-doc errors to be raised in that case, you will now have to add
accept-no-raise-doc=noin your configuration to keep the same behavior. Closes #β7208
New Features
-
Added the
no-headeroutput format. If enabled with--output-format=no-header, it will not include the module name in the output. Closes #β5362 -
Added configuration option
clear-cache-post-runto support server-like usage. Use this flag if you expect the linted files to be altered between runs. Refs #β5401 -
Add
--allow-reexport-from-packageoption to configure theuseless-import-aliascheck not to emit a warning if a name is reexported from a package. Closes #β6006 -
Update
pyreverseto differentiate between aggregations and compositions.pyreversechecks if it's an Instance or a Call of an object via method parameters (via type hints) to decide if it's a composition or an aggregation. Refs #β6543
New Checks
-
Adds a
pointless-exception-statementcheck that emits a warning when an Exception is created and not assigned, raised or returned. Refs #β3110 -
Add a
shadowed-importmessage for aliased imports. Closes #β4836 -
Add new check called
unbalanced-dict-unpackingto check for unbalanced dict unpacking in assignment and for loops. Closes #β5797 -
Add new checker
positional-only-arguments-expectedto check for cases when positional-only arguments have been passed as keyword arguments. Closes #β6489 -
Added
singledispatch-methodwhich informs that@singledispatchshould decorate functions and not class/instance methods. Addedsingledispatchmethod-functionwhich informs that@singledispatchmethodshould decorate class/instance methods and not functions. Closes #β6917 -
Rename
broad-excepttobroad-exception-caughtand add new checkerbroad-exception-raisedwhich will warn if general exceptionsBaseExceptionorExceptionare raised. Closes #β7494 -
Added
nested-min-maxwhich flagsmin(1, min(2, 3))to simplify tomin(1, 2, 3). Closes #β7546 -
Extended
use-dict-literalto also warn about call todict()when passing keyword arguments. Closes #β7690 -
Add
named-expr-without-contextcheck to emit a warning if a named expression is used outside a context likeif,for,while, or a comprehension. Refs #β7760 -
Add
invalid-slice-stepcheck to warn about a slice step value of0for common builtin sequences. Refs #β7762 -
Add
consider-refactoring-into-while-conditioncheck to recommend refactoring when a while loop is defined with a constant condition with an immediateifstatement to check forbreakcondition as a first statement. Closes #β8015
Extensions
-
Add new extension checker
dict-init-mutatethat flags mutating a dictionary immediately after the dictionary was created. Closes #β2876 -
Added
bad-dunder-nameextension check, which flags bad or misspelled dunder methods. You can use thegood-dunder-namesoption to allow specific dunder names. Closes #β3038 -
Added
consider-using-augmented-assigncheck forCodeStyleextension which flagsx = x + 1to simplify tox += 1. This check is disabled by default. To use it, load the code style extension withload-plugins=pylint.extensions.code_styleand addconsider-using-augmented-assignin theenableoption. Closes #β3391 -
Add
magic-numberplugin checker for comparison with constants instead of named constants or enums. You can use it with--load-plugins=pylint.extensions.magic_value. Closes #β7281 -
Add
redundant-typehint-argumentmessage fortypingplugin for duplicate assign typehints. Enable the plugin to enable the message with:--load-plugins=pylint.extensions.typing. Closes #β7636
False Positives Fixed
-
Fix false positive for
unused-variableandunused-importwhen a name is only used in a string literal type annotation. Closes #β3299 -
Document a known false positive for
useless-suppressionwhen disablingline-too-longin a module with only comments and no code. Closes #β3368 -
trailing-whitespacesis no longer reported within strings. Closes #β3822 -
Fix false positive for
global-variable-not-assignedwhen a global variable is re-assigned via anImportFromnode. Closes #β4809 -
Fix false positive for
use-maxsplit-argwith custom split method. Closes #β4857 -
Fix
logging-fstring-interpolationfalse positive raised when logging and f-string with%sformatting. Closes #β4984 -
Fix false-positive for
used-before-assignmentin pattern matching with a guard. Closes #β5327 -
Fix
use-sequence-for-iterationwhen unpacking a set with*. Closes #β5788 -
Fix
deprecated-methodfalse positive when alias for method is similar to name of deprecated method. Closes #β5886 -
Fix false positive
assigning-non-slotwhen a class attribute is re-assigned. Closes #β6001 -
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 -
Fixes false positive
abstract-methodon Protocol classes. Closes #β7209 -
Pylint now understands the
kw_onlykeyword argument fordataclass. Closes #β7290, closes #β6550, closes #β5857 -
Fix false positive for
undefined-loop-variableinfor-elseloops that use a function having a return type annotation ofNoReturnorNever. Closes #β7311 -
Fix
used-before-assignmentfor functions/classes defined in type checking guard. Closes #β7368 -
Fix false positive for
unhashable-memberwhen subclassingdictand using the subclass as a dictionary key. Closes #β7501 -
Fix the message for
unnecessary-dunder-callfor__aiter__and__aneext__. Also only emit the warning whenpy-version>= 3.10. Closes #β7529 -
Fix
used-before-assignmentfalse positive when else branch callssys.exitor similar terminating functions. Closes #β7563 -
Fix a false positive for
used-before-assignmentfor imports guarded bytyping.TYPE_CHECKINGlater used in variable annotations. Closes #β7609 -
Fix a false positive for
simplify-boolean-expressionwhen multiple values are inferred for a constant. Closes #β7626 -
unnecessary-list-index-lookupwill not be wrongly emitted ifenumerateis called withstart. Closes #β7682 -
Don't warn about
stop-iteration-returnwhen usingnext()overitertools.cycle. Closes #β7765 -
Fixes
used-before-assignmentfalse positive when the walrus operator is used in a ternary operator. Closes #β7779 -
Fix
missing-param-docfalse positive when function parameter has an escaped underscore. Closes #β7827 -
Fixes
method-cache-max-size-nonefalse positive for methods inheriting fromEnum. Closes #β7857 -
multiple-statementsno longer triggers for function stubs using inlined.... Closes #β7860 -
Fix a false positive for
used-before-assignmentwhen a name guarded byif TYPE_CHECKING:is used as a type annotation in a function body and later re-imported in the same scope. Closes #β7882 -
Prevent
used-before-assignmentwhen imports guarded byif TYPE_CHECKINGare guarded again when used. Closes #β7979 -
Fixes false positive for
try-except-raisewith multiple exceptions in one except statement if exception are in different namespace. Closes #β8051 -
Fix
invalid-nameerrors fortyping_extension.TypeVar. Refs #β8089 -
Fix
no-kwoafalse positive for context managers. Closes #β8100 -
Fix a false positive for
redefined-variable-typewhenasyncmethods are present. Closes #β8120
False Negatives Fixed
-
Code following a call to
quit,exit,sys.exitoros._exitwill be marked asunreachable. Refs #β519 -
Emit
used-before-assignmentwhen function arguments are redefined inside an inner function and accessed there before assignment. Closes #β2374 -
Fix a false negative for
unused-importwhen one module used an import in a type annotation that was also used in another module. Closes #β4150 -
Flag
superfluous-parensif parentheses are used during string concatenation. Closes #β4792 -
Emit
used-before-assignmentwhen relying on names only defined under conditions always testing false. Closes #β4913 -
consider-using-joincan now be emitted for non-empty string separators. Closes #β6639 -
Emit
used-before-assignmentfor further imports guarded byTYPE_CHECKINGPreviously, this message was only emitted for imports guarded directly underTYPE_CHECKING, not guarded two if-branches deep, nor whenTYPE_CHECKINGwas imported fromtypingunder an alias. Closes #β7539 -
Fix a false negative for
unused-importwhen a constant insidetyping.Annotatedwas treated as a reference to an import. Closes #β7547 -
consider-using-any-or-allmessage will now be raised in cases when boolean is initialized, reassigned during loop, and immediately returned. Closes #β7699 -
Extend
invalid-slice-indexto emit an warning for invalid slice indices used with string and byte sequences, and range objects. Refs #β7762 -
Fixes
unnecessary-list-index-lookupfalse negative whenenumerateis called withiterableas a kwarg. Closes #β7770 -
no-else-returnorno-else-raisewill be emitted ifexceptblock always returns or raises. Closes #β7788 -
Fix
dangerous-default-valuefalse negative when*is used. Closes #β7818 -
consider-using-withnow triggers forpathlib.Path.open. Closes #β7964
Other Bug Fixes
-
Fix bug in detecting
unused-variablewhen iterating on variable. Closes #β3044 -
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 -
Update
disallowed-namecheck to flag module-level variables. Closes #β3701 -
Pylint will no longer deadlock if a parallel job is killed but fail immediately instead. Closes #β3899
-
Fix ignored files being linted when passed on stdin. Closes #β4354
-
Fix
no-memberfalse negative when augmented assign is done manually, without+=. Closes #β4562 -
Any assertion on a populated tuple will now receive a
assert-on-tuplewarning. Closes #β4655 -
missing-return-doc,missing-raises-docandmissing-yields-docnow respect theno-docstring-rgxoption. Closes #β4743 -
Update
reimportedhelp message for clarity. Closes #β4836 -
consider-iterating-dictionarywill no longer be raised if bitwise operations are used. Closes #β5478 -
Using custom braces in
msg-templatewill now work properly. Closes #β5636 -
Pylint will now filter duplicates given to it before linting. The output should be the same whether a file is given/discovered multiple times or not. Closes #β6242, #β4053
-
Remove
__index__dunder method call fromunnecessary-dunder-callcheck. Closes #β6795 -
Fixed handling of
--as separator between positional arguments and flags. This was not actually fixed in 2.14.5. Closes #β7003, Refs #β7096 -
Don't crash on
OSErrorin config file discovery. Closes #β7169 -
Messages sent to reporter are now copied so a reporter cannot modify the message sent to other reporters. Closes #β7214
-
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. -
Update
modified_iteratingchecker to fix a crash withforloops on empty list. Closes #β7380 -
Update wording for
arguments-differandarguments-renamedto clarify overriding object. Closes #β7390 -
disable-nextis now correctly scoped to only the succeeding line. Closes #β7401 -
Fixed a crash in the
unhashable-memberchecker when using alambdaas a dict key. Closes #β7453 -
Add
mailcapto deprecated modules list. Closes #β7457 -
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 -
--help-msgnow accepts a comma-separated list of message IDs again. Closes #β7471 -
Allow specifying non-builtin exceptions in the
overgeneral-exceptionoption using an exception's qualified name. Closes #β7495 -
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 aliasingtypinge.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 -
Use
py-versionto determine if a message should be emitted for messages defined withmax-versionormin-version. Closes #β7569 -
Improve
bad-thread-instantiationcheck to warn iftargetis not passed in as a keyword argument or as a second argument. Closes #β7570 -
Fixes edge case of custom method named
nextraised an astroid error. Closes #β7610 -
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. -
Fix crash that happened when parsing files with unexpected encoding starting with 'utf' like
utf13. 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 -
Fix
valid-metaclass-classmethod-first-argdefault config value from "cls" to "mcs" which would cause both a false-positive and false-negative. Closes #β7782 -
Fixes a crash in the
unnecessary_list_index_lookupcheck when usingenumeratewithstartand a class attribute. Closes #β7821 -
Fixes a crash in
stop-iteration-returnwhen thenextbuiltin is called without arguments. Closes #β7828 -
When pylint exit due to bad arguments being provided the exit code will now be the expected
32. Refs #β7931 -
Fixes a
ModuleNotFoundexception when running pylint on a Django project with thepylint_djangoplugin enabled. Closes #β7938 -
Fixed a crash when inferring a value and using its qname on a slice that was being incorrectly called. Closes #β8067
-
Use better regex to check for private attributes. Refs #β8081
-
Fix issue with new typing Union syntax in runtime context for Python 3.10+. Closes #β8119
Other Changes
-
Pylint now provides basic support for Python 3.11. Closes #β5920
-
Update message for
abstract-methodto include child class name. Closes #β7124 -
Update Pyreverse's dot and plantuml printers to detect when class methods are abstract and show them with italic font. For the dot printer update the label to use html-like syntax. Closes #β7346
-
The
docparamsextension now considers typing in Numpy style docstrings as "documentation" for themissing-param-docmessage. Refs #β7398 -
Relevant
DeprecationWarningsare now raised withstacklevel=2, so they have the callsite attached in the message. Closes #β7463 -
Add a
minimaloption topylint-configand its toml generator. Closes #β7485 -
Add method name to the error messages of
no-method-argumentandno-self-argument. Closes #β7507 -
Prevent leaving the pip install cache in the Docker image. Refs #β7544
-
Add a keyword-only
compare_constantsargument tosafe_infer. Refs #β7626 -
Add
default_enabledoption to optional message dict. Provides an option to disable a checker message by default. To use a disabled message, the user must enable it explicitly by adding the message to theenableoption. Refs #β7629 -
Sort
--generated-rcfileoutput. Refs #β7655 -
epylint is now deprecated and will be removed in pylint 3.0.0. All emacs and flymake related files were removed and their support will now happen in an external repository : https://github.com/emacsorphanage/pylint. Closes #β7737
-
Adds test for existing preferred-modules configuration functionality. Refs #β7957
Internal Changes
- Add and fix regression tests for plugin loading.
This shores up the tests that cover the loading of custom plugins as affected
by any changes made to the
sys.pathduring execution of aninit-hook. Given the existing contract of allowing plugins to be loaded by fiddling with the path in this way, this is now the last bit of work needed to close Github issue #β7264. Closes #β7264
v2.15.10
False Positives Fixed
-
Fix
use-sequence-for-iterationwhen unpacking a set with*.Closes #β5788
-
Fix false positive
assigning-non-slotwhen a class attribute is re-assigned.Closes #β6001
-
Fixes
used-before-assignmentfalse positive when the walrus operator is used in a ternary operator.Closes #β7779
-
Prevent
used-before-assignmentwhen imports guarded byif TYPE_CHECKINGare guarded again when used.Closes #β7979
Other Bug Fixes
-
Using custom braces in
msg-templatewill now work properly.Closes #β5636
v2.15.9
False Positives Fixed
-
Fix false-positive for
used-before-assignmentin pattern matching with a guard.Closes #β5327
Other Bug Fixes
-
Pylint will no longer deadlock if a parallel job is killed but fail immediately instead.
Closes #β3899
-
When pylint exit due to bad arguments being provided the exit code will now be the expected
32.Refs #β7931
-
Fixes a
ModuleNotFoundexception when running pylint on a Django project with thepylint_djangoplugin enabled.Closes #β7938
v2.15.8
False Positives Fixed
-
Document a known false positive for
useless-suppressionwhen disablingline-too-longin a module with only comments and no code.Closes #β3368
-
Fix
logging-fstring-interpolationfalse positive raised when logging and f-string with%sformatting.Closes #β4984
-
Fixes false positive
abstract-methodon Protocol classes.Closes #β7209
-
Fix
missing-param-docfalse positive when function parameter has an escaped underscore.Closes #β7827
-
multiple-statementsno longer triggers for function stubs using inlined....Closes #β7860
v2.15.7
False Positives Fixed
-
Fix
deprecated-methodfalse positive when alias for method is similar to name of deprecated method.Closes #β5886
-
Fix a false positive for
used-before-assignmentfor imports guarded bytyping.TYPE_CHECKINGlater used in variable annotations.Closes #β7609
Other Bug Fixes
-
Pylint will now filter duplicates given to it before linting. The output should be the same whether a file is given/discovered multiple times or not.
-
Fixes a crash in
stop-iteration-returnwhen thenextbuiltin is called without arguments.Closes #β7828
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 ifenumerateis called withstart.Closes #β7682
-
Don't warn about
stop-iteration-returnwhen usingnext()overitertools.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' like
utf13.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-callcheck.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
-
Add a keyword-only
compare_constantsargument tosafe_infer.Refs #β7626
-
Sort
--generated-rcfileoutput.Refs #β7655
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 aliasingtypinge.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-argumentandno-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.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 https://github.com/PyCQA/pylint/issues/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 Chec
Configuration
π Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
Codecov Report
Patch coverage has no change and project coverage change: +0.07 :tada:
Comparison is base (
ffb2047) 86.09% compared to head (4f8153e) 86.17%.
:exclamation: Current head 4f8153e differs from pull request most recent head d56b251. Consider uploading reports for the commit d56b251 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## main #319 +/- ##
==========================================
+ Coverage 86.09% 86.17% +0.07%
==========================================
Files 107 107
Lines 9733 9705 -28
==========================================
- Hits 8380 8363 -17
+ Misses 1353 1342 -11
| Impacted Files | Coverage Ξ | |
|---|---|---|
| mlem/contrib/pandas.py | 93.69% <0.00%> (-0.09%) |
:arrow_down: |
| mlem/core/objects.py | 87.26% <0.00%> (-0.07%) |
:arrow_down: |
| mlem/cli/types.py | 94.64% <0.00%> (ΓΈ) |
|
| mlem/contrib/sagemaker/meta.py | 50.00% <0.00%> (ΓΈ) |
|
| mlem/contrib/docker/context.py | 82.39% <0.00%> (+0.61%) |
:arrow_up: |
| mlem/contrib/pip/base.py | 100.00% <0.00%> (+1.17%) |
:arrow_up: |
| mlem/api/migrations.py | 95.91% <0.00%> (+1.18%) |
:arrow_up: |
| mlem/cli/utils.py | 87.33% <0.00%> (+1.89%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.