| 1 |
:Release: 2.9 |
| 2 |
:Date: 2021-06-29 |
| 3 |
|
| 4 |
Summary -- Release highlights |
| 5 |
============================= |
| 6 |
|
| 7 |
Pylint is now compatible with python 3.10. |
| 8 |
|
| 9 |
A lot of new checks have been added, some non-opinionated performance warnings |
| 10 |
like ``use-maxsplit-arg``, some consensual style warnings like |
| 11 |
``unnecessary-dict-index-lookup`` or new deprecation checks. |
| 12 |
|
| 13 |
We're aiming to reduce pylint noise for first time users and making some |
| 14 |
new checks optional is a step in that direction. In order to do that we |
| 15 |
created an optional code style checker that can be loaded using |
| 16 |
``pylint.extensions.code_style`` with the ``load-plugins`` options. |
| 17 |
More than ever, if as a veteran you want the most checks you can possibly get, |
| 18 |
`you should check the list of pylint extensions. <https://pylint.readthedocs.io/en/latest/user_guide/checkers/extensions.html#optional-checkers>`_. |
| 19 |
|
| 20 |
|
| 21 |
New checkers |
| 22 |
============ |
| 23 |
|
| 24 |
* ``deprecated-decorator``: Emitted when deprecated decorator is used. |
| 25 |
|
| 26 |
* ``consider-using-dict-items``: Emitted when iterating over dictionary keys and then |
| 27 |
indexing the same dictionary with the key within loop body. |
| 28 |
|
| 29 |
* ``use-maxsplit-arg``: Emitted either when accessing only the first or last |
| 30 |
element of ``str.split()``. |
| 31 |
|
| 32 |
* An ``ignore_signatures`` option has been added to the similarity checker. It will permits to reduce false positives when multiple functions have the same parameters. |
| 33 |
|
| 34 |
* ``unnecessary-dict-index-lookup``: Emitted when iterating over dictionary items |
| 35 |
(key-value pairs) and accessing the value by index lookup. |
| 36 |
|
| 37 |
* ``consider-using-from-import``: Emitted when a submodule/member of a package is imported and aliased with the same name. |
| 38 |
|
| 39 |
* New checker ``unused-private-member``: Emitted when a private member (i.e., starts with ``__``) of a class is defined but not used. |
| 40 |
|
| 41 |
* New checker ``invalid-class-object``: Emitted when a non-class is assigned to a ``__class__`` attribute. |
| 42 |
|
| 43 |
* ``invalid-all-format``: Emitted when ``__all__`` has an invalid format, |
| 44 |
i.e. isn't a ``tuple`` or ``list``. |
| 45 |
|
| 46 |
* New checker ``await-outside-async``: Emitted when await is used outside an async function. |
| 47 |
|
| 48 |
* Add new extension ``CodeStyleChecker``. It includes checkers that can improve code |
| 49 |
consistency. As such they don't necessarily provide a performance benefit |
| 50 |
and are often times opinionated. |
| 51 |
|
| 52 |
* ``consider-using-tuple``: Emitted when an in-place defined list or set can be replaced by a tuple. |
| 53 |
|
| 54 |
* ``consider-using-namedtuple-or-dataclass``: Emitted when dictionary values |
| 55 |
can be replaced by namedtuples or dataclass instances. |
| 56 |
|
| 57 |
|
| 58 |
Other Changes |
| 59 |
============= |
| 60 |
|
| 61 |
* Fix false-positive ``consider-using-with`` (R1732) if a ternary conditional is used together with ``with`` |
| 62 |
|
| 63 |
* Fix false-positive ``consider-using-with`` (R1732) if ``contextlib.ExitStack`` takes care of calling the ``__exit__`` method |
| 64 |
|
| 65 |
* Add type annotations to pyreverse dot files |
| 66 |
|
| 67 |
* Pylint's tags are now the standard form ``vX.Y.Z`` and not ``pylint-X.Y.Z`` anymore. |
| 68 |
|
| 69 |
* Fix false-positive ``too-many-ancestors`` when inheriting from builtin classes, |
| 70 |
especially from the ``collections.abc`` module |
| 71 |
|
| 72 |
* The output messages for ``arguments-differ`` error message have been customized based on the different error cases. |
| 73 |
|
| 74 |
* New option ``--fail-on=<msg ids>`` to return non-zero exit codes regardless of ``fail-under`` value. |
| 75 |
|
| 76 |
* A new error called ``arguments-renamed`` has been created, which identifies any changes at the parameter names |
| 77 |
of overridden functions. It aims to separate the functionality of ``arguments-differ``. |
| 78 |
|
| 79 |
* Fix incompatibility with Python 3.6.0 caused by ``typing.Counter`` and ``typing.NoReturn`` usage |
| 80 |
|
| 81 |
* Allow comma-separated list in ``output-format`` and separate output files for |
| 82 |
each specified format. Each output file can be defined after a semicolon for example : ``--output-format=json:myfile.json,colorized`` |
| 83 |
|
| 84 |
* The ``using-constant-test`` checker now detects constant tests consisting of list literals |
| 85 |
like ``[]`` and ``[1, 2, 3]``. |
| 86 |
|
| 87 |
* ``ignore-paths`` configuration directive has been added. Defined regex patterns are matched against file path. |
| 88 |
|
| 89 |
* Added handling of floating point values when parsing configuration from pyproject.toml |
| 90 |
|
| 91 |
* Fix false positive ``useless-type-doc`` on ignored argument using ``pylint.extensions.docparams`` when a function |
| 92 |
was typed using pep484 but not inside the docstring. |
| 93 |
|
| 94 |
* Fix missing support for detecting deprecated aliases to existing functions/methods. |
| 95 |
functions/methods. |
| 96 |
|
| 97 |
* Added various deprecated functions/methods for python 3.10, 3.7, 3.6 and 3.3 |
| 98 |
|
| 99 |
* No longer emit ``consider-using-with`` for ``ThreadPoolExecutor`` and ``ProcessPoolExecutor`` |
| 100 |
as they have legitimate use cases without a ``with`` block. |
| 101 |
|
| 102 |
* Fix crash if a callable returning a context manager was assigned to a list or dict item |