Skip to content

Commit

Permalink
Bump pylint to 2.12.0, update changelog
Browse files Browse the repository at this point in the history
Closes #5250
  • Loading branch information
Pierre-Sassoulas committed Nov 24, 2021
1 parent be149db commit 5ac091b
Show file tree
Hide file tree
Showing 59 changed files with 166 additions and 48 deletions.
32 changes: 22 additions & 10 deletions ChangeLog
Expand Up @@ -2,14 +2,34 @@
Pylint's ChangeLog
------------------

What's New in Pylint 2.13.0?
============================
Release date: TBA

..
Put new features here and also in 'doc/whatsnew/2.13.rst'


What's New in Pylint 2.12.0?
..
Insert your changelog randomly, it will reduce merge conflicts
(Ie. not necessarilly at the end)


What's New in Pylint 2.12.1?
============================
Release date: TBA

..
Put new features here and also in 'doc/whatsnew/2.12.rst'
Put bug fixes that should not wait for a new minor version here

..
Insert your changelog randomly, it will reduce merge conflicts
(Ie. not necessarilly at the end)


What's New in Pylint 2.12.0?
============================
Release date: 2021-11-24

* Upgrade astroid to 2.9.0

Expand Down Expand Up @@ -227,14 +247,6 @@ Release date: TBA

* Inheriting from a class that implements ``__class_getitem__`` no longer raises ``inherit-non-class``.


What's New in Pylint 2.11.2?
============================
Release date: TBA

..
Put bug fixes that should not wait for a new minor version here

* Pyreverse - Add the project root directory to sys.path

Closes #2479
Expand Down
38 changes: 23 additions & 15 deletions doc/whatsnew/2.12.rst
Expand Up @@ -3,11 +3,25 @@
***************************

:Release: 2.12
:Date: TBA
:Date: 2021-11-24

Summary -- Release highlights
=============================

In 2.12, we introduced a new option ``py-version`` that permits to analyse code for a python
version that may differ from your current python interpreter. This does not affect all checkers but
permits, for example, to check for python 3.5 code smells (using f-string's) while using pylint with python 3.6.
The minimum version to run pylint is now 3.6.2, while the last working version for python 3.6.0
and 3.6.1 was pylint 2.9.3.

On top of fixing a lot of false positives and bugs, we also added new default checks, like
``use-implicit-booleaness-not-comparison``, ``overridden-final-method``, and ``useless-with-lock``.
There's also better check for TOML configurations.

The checker for Yoda conditions is now an extension, you might want to enable it if you were
relying on this check. There's also a new extension checker, ``consider-using-any-or-all`` that
detects for loops that could be replaced by any or all, entirely contributed by @areveny,
welcome to the team !

New checkers
============
Expand All @@ -33,11 +47,6 @@ New checkers
* Added ``using-f-string-in-unsupported-version`` checker. Issued when ``py-version``
is set to a version that does not support f-strings (< 3.6)

* Fix ``useless-super-delegation`` false positive when default keyword argument is a variable.

* Added new checker ``use-implicit-booleanness``: Emitted when using collection
literals for boolean comparisons

* Added new checker ``use-implicit-booleaness-not-comparison``: Emitted when
collection literal comparison is being used to check for emptiness.

Expand All @@ -46,11 +55,6 @@ New checkers
* Added ``using-final-decorator-in-unsupported-version`` checker. Issued when ``py-version``
is set to a version that does not support typing.final (< 3.8)

* Added configuration option ``exclude-too-few-public-methods`` to allow excluding
classes from the ``min-public-methods`` checker.

Closes #3370

* Added new checker ``useless-with-lock`` to find incorrect usage of with statement and threading module locks.
Emitted when ``with threading.Lock():`` is used instead of ``with lock_instance:``.

Expand All @@ -69,12 +73,9 @@ New checkers
* ``add_message`` of the unittest ``testutil`` now actually handles the ``col_offset`` parameter
and allows it to be checked against actual output in a test.

Removed checkers
================


Extensions
==========

* Added an optional extension ``consider-using-any-or-all``: Emitted when a ``for`` loop only
produces a boolean and could be replaced by ``any`` or ``all`` using a generator. Also suggests
a suitable any/all statement if it is concise.
Expand All @@ -96,6 +97,11 @@ Other Changes

Closes #5178

* Added configuration option ``exclude-too-few-public-methods`` to allow excluding
classes from the ``min-public-methods`` checker.

Closes #3370

* Fix ``accept-no-yields-doc`` and ``accept-no-return-doc`` not allowing missing ``yield`` or
``return`` documentation when a docstring is partially correct

Expand Down Expand Up @@ -196,6 +202,8 @@ Other Changes

* Fix crash for ``protected-access`` on (outer) class traversal

* Fix ``useless-super-delegation`` false positive when default keyword argument is a variable.

* Make yn validator case insensitive, to allow for ``True`` and ``False`` in config files.

* The last version compatible with python '3.6.0' and '3.6.1' is pylint '2.9.3'. We did not
Expand Down
21 changes: 21 additions & 0 deletions doc/whatsnew/2.13.rst
@@ -0,0 +1,21 @@
***************************
What's New in Pylint 2.13
***************************

:Release: 2.13
:Date: TBA

Summary -- Release highlights
=============================

New checkers
============

Removed checkers
================

Extensions
==========

Other Changes
=============
1 change: 1 addition & 0 deletions doc/whatsnew/index.rst
Expand Up @@ -9,6 +9,7 @@ High level descriptions of the most important changes between major Pylint versi
.. toctree::
:maxdepth: 1

2.13.rst
2.12.rst
2.11.rst
2.10.rst
Expand Down
2 changes: 1 addition & 1 deletion pylint/__pkginfo__.py
Expand Up @@ -2,7 +2,7 @@
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
from typing import Tuple

__version__ = "2.11.2-dev0"
__version__ = "2.12.0"


def get_numversion_from_version(v: str) -> Tuple:
Expand Down
7 changes: 6 additions & 1 deletion pylint/checkers/base.py
Expand Up @@ -25,7 +25,7 @@
# Copyright (c) 2017 Jacques Kvam <jwkvam@gmail.com>
# Copyright (c) 2017 ttenhoeve-aa <ttenhoeve@appannie.com>
# Copyright (c) 2018-2019, 2021 Nick Drozd <nicholasdrozd@gmail.com>
# Copyright (c) 2018-2019 Ville Skyttä <ville.skytta@iki.fi>
# Copyright (c) 2018-2019, 2021 Ville Skyttä <ville.skytta@iki.fi>
# Copyright (c) 2018 Sergei Lebedev <185856+superbobry@users.noreply.github.com>
# Copyright (c) 2018 Lucas Cimon <lucas.cimon@gmail.com>
# Copyright (c) 2018 ssolanki <sushobhitsolanki@gmail.com>
Expand Down Expand Up @@ -53,7 +53,12 @@
# Copyright (c) 2020 Benny <benny.mueller91@gmail.com>
# Copyright (c) 2020 Anubhav <35621759+anubh-v@users.noreply.github.com>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 Tushar Sadhwani <tushar.sadhwani000@gmail.com>
# Copyright (c) 2021 Tim Martin <tim@asymptotic.co.uk>
# Copyright (c) 2021 Jaehoon Hwang <jaehoonhwang@users.noreply.github.com>
# Copyright (c) 2021 jaydesl <35102795+jaydesl@users.noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Copyright (c) 2021 bot <bot@noreply.github.com>
# Copyright (c) 2021 Yilei "Dolee" Yang <yileiyang@google.com>
# Copyright (c) 2021 Lorena B <46202743+lorena-b@users.noreply.github.com>
# Copyright (c) 2021 David Liu <david@cs.toronto.edu>
Expand Down
1 change: 1 addition & 0 deletions pylint/checkers/base_checker.py
Expand Up @@ -12,6 +12,7 @@
# Copyright (c) 2019 Bruno P. Kinoshita <kinow@users.noreply.github.com>
# Copyright (c) 2020 hippo91 <guillaume.peillex@gmail.com>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 bot <bot@noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>

# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Expand Down
9 changes: 7 additions & 2 deletions pylint/checkers/classes.py
Expand Up @@ -16,14 +16,14 @@
# Copyright (c) 2016 Moises Lopez <moylop260@vauxoo.com>
# Copyright (c) 2016 Jakub Wilk <jwilk@jwilk.net>
# Copyright (c) 2017, 2019-2020 hippo91 <guillaume.peillex@gmail.com>
# Copyright (c) 2018, 2021 Ville Skyttä <ville.skytta@iki.fi>
# Copyright (c) 2018, 2020 Anthony Sottile <asottile@umich.edu>
# Copyright (c) 2018-2019 Nick Drozd <nicholasdrozd@gmail.com>
# Copyright (c) 2018-2019 Ashley Whetter <ashley@awhetter.co.uk>
# Copyright (c) 2018 Lucas Cimon <lucas.cimon@gmail.com>
# Copyright (c) 2018 Bryce Guinta <bryce.paul.guinta@gmail.com>
# Copyright (c) 2018 ssolanki <sushobhitsolanki@gmail.com>
# Copyright (c) 2018 Ben Green <benhgreen@icloud.com>
# Copyright (c) 2018 Ville Skyttä <ville.skytta@iki.fi>
# Copyright (c) 2019-2021 Pierre Sassoulas <pierre.sassoulas@gmail.com>
# Copyright (c) 2019 mattlbeck <17108752+mattlbeck@users.noreply.github.com>
# Copyright (c) 2019-2020 craig-sh <craig-sh@users.noreply.github.com>
Expand All @@ -34,10 +34,15 @@
# Copyright (c) 2019 Pascal Corpet <pcorpet@users.noreply.github.com>
# Copyright (c) 2020 GergelyKalmar <gergely.kalmar@logikal.jp>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com>
# Copyright (c) 2021 Samuel Freilich <sfreilich@google.com>
# Copyright (c) 2021 Nick Pesce <nickpesce22@gmail.com>
# Copyright (c) 2021 Nick Pesce <npesce@terpmail.umd.edu>
# Copyright (c) 2021 bot <bot@noreply.github.com>
# Copyright (c) 2021 yushao2 <36848472+yushao2@users.noreply.github.com>
# Copyright (c) 2021 SupImDos <62866982+SupImDos@users.noreply.github.com>
# Copyright (c) 2021 Kayran Schmidt <59456929+yumasheta@users.noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Copyright (c) 2021 Yu Shao, Pang <p.yushao2@gmail.com>
# Copyright (c) 2021 Konstantina Saketou <56515303+ksaketou@users.noreply.github.com>
# Copyright (c) 2021 James Sinclair <james@nurfherder.com>
Expand Down
4 changes: 4 additions & 0 deletions pylint/checkers/design_analysis.py
Expand Up @@ -15,7 +15,11 @@
# Copyright (c) 2019 Michael Scott Cuthbert <cuthbert@mit.edu>
# Copyright (c) 2020 hippo91 <guillaume.peillex@gmail.com>
# Copyright (c) 2020 Anthony Sottile <asottile@umich.edu>
# Copyright (c) 2021 Mike Fiedler <miketheman@gmail.com>
# Copyright (c) 2021 Youngsoo Sung <ysung@bepro11.com>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 bot <bot@noreply.github.com>
# Copyright (c) 2021 Andrew Haigh <hello@nelf.in>
# Copyright (c) 2021 Melvin <31448155+melvio@users.noreply.github.com>
# Copyright (c) 2021 Rebecca Turner <rbt@sent.as>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Expand Down
1 change: 1 addition & 0 deletions pylint/checkers/exceptions.py
Expand Up @@ -27,6 +27,7 @@
# Copyright (c) 2020 Ram Rachum <ram@rachum.com>
# Copyright (c) 2020 Anthony Sottile <asottile@umich.edu>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 Nick Drozd <nicholasdrozd@gmail.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>

# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Expand Down
3 changes: 3 additions & 0 deletions pylint/checkers/format.py
Expand Up @@ -37,6 +37,9 @@
# Copyright (c) 2019 Hugo van Kemenade <hugovk@users.noreply.github.com>
# Copyright (c) 2020 Raphael Gaschignard <raphael@rtpg.co>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 Tushar Sadhwani <tushar.sadhwani000@gmail.com>
# Copyright (c) 2021 bot <bot@noreply.github.com>
# Copyright (c) 2021 Ville Skyttä <ville.skytta@iki.fi>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>

# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Expand Down
1 change: 1 addition & 0 deletions pylint/checkers/imports.py
Expand Up @@ -34,6 +34,7 @@
# Copyright (c) 2020 Peter Kolbus <peter.kolbus@gmail.com>
# Copyright (c) 2020 Damien Baty <damien.baty@polyconseil.fr>
# Copyright (c) 2020 Anthony Sottile <asottile@umich.edu>
# Copyright (c) 2021 Tushar Sadhwani <tushar.sadhwani000@gmail.com>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Copyright (c) 2021 Will Shanks <wsha@posteo.net>
Expand Down
1 change: 1 addition & 0 deletions pylint/checkers/logging.py
Expand Up @@ -17,6 +17,7 @@
# Copyright (c) 2019 Djailla <bastien.vallet@gmail.com>
# Copyright (c) 2019 Svet <svet@hyperscience.com>
# Copyright (c) 2020 Anthony Sottile <asottile@umich.edu>
# Copyright (c) 2021 Nick Drozd <nicholasdrozd@gmail.com>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Expand Down
1 change: 1 addition & 0 deletions pylint/checkers/raw_metrics.py
Expand Up @@ -10,6 +10,7 @@
# Copyright (c) 2020-2021 hippo91 <guillaume.peillex@gmail.com>
# Copyright (c) 2020 谭九鼎 <109224573@qq.com>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 bot <bot@noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>

# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Expand Down
1 change: 1 addition & 0 deletions pylint/checkers/refactoring/__init__.py
Expand Up @@ -29,6 +29,7 @@
# Copyright (c) 2020 lrjball <50599110+lrjball@users.noreply.github.com>
# Copyright (c) 2020 Yang Yang <y4n9squared@gmail.com>
# Copyright (c) 2020 Anthony Sottile <asottile@umich.edu>
# Copyright (c) 2021 Jaehoon Hwang <jaehoonhwang@users.noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>

# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Expand Down
1 change: 1 addition & 0 deletions pylint/checkers/similar.py
Expand Up @@ -18,6 +18,7 @@
# Copyright (c) 2020 Eli Fine <ejfine@gmail.com>
# Copyright (c) 2020 Shiv Venkatasubrahmanyam <shvenkat@users.noreply.github.com>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 Ville Skyttä <ville.skytta@iki.fi>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Copyright (c) 2021 Maksym Humetskyi <Humetsky@gmail.com>
# Copyright (c) 2021 bot <bot@noreply.github.com>
Expand Down
2 changes: 2 additions & 0 deletions pylint/checkers/spelling.py
Expand Up @@ -18,6 +18,8 @@
# Copyright (c) 2020 hippo91 <guillaume.peillex@gmail.com>
# Copyright (c) 2020 Damien Baty <damien.baty@polyconseil.fr>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 Tushar Sadhwani <tushar.sadhwani000@gmail.com>
# Copyright (c) 2021 Nick Drozd <nicholasdrozd@gmail.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Copyright (c) 2021 bot <bot@noreply.github.com>
# Copyright (c) 2021 Andreas Finkler <andi.finkler@gmail.com>
Expand Down
2 changes: 2 additions & 0 deletions pylint/checkers/strings.py
Expand Up @@ -24,6 +24,8 @@
# Copyright (c) 2020 hippo91 <guillaume.peillex@gmail.com>
# Copyright (c) 2020 谭九鼎 <109224573@qq.com>
# Copyright (c) 2020 Anthony <tanant@users.noreply.github.com>
# Copyright (c) 2021 Tushar Sadhwani <tushar.sadhwani000@gmail.com>
# Copyright (c) 2021 Jaehoon Hwang <jaehoonhwang@users.noreply.github.com>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Copyright (c) 2021 Peter Kolbus <peter.kolbus@garmin.com>
Expand Down
5 changes: 3 additions & 2 deletions pylint/checkers/typecheck.py
Expand Up @@ -16,10 +16,10 @@
# Copyright (c) 2016 Jürgen Hermann <jh@web.de>
# Copyright (c) 2016 Jakub Wilk <jwilk@jwilk.net>
# Copyright (c) 2016 Filipe Brandenburger <filbranden@google.com>
# Copyright (c) 2017, 2021 Ville Skyttä <ville.skytta@iki.fi>
# Copyright (c) 2017-2018, 2020 hippo91 <guillaume.peillex@gmail.com>
# Copyright (c) 2017 Łukasz Rogalski <rogalski.91@gmail.com>
# Copyright (c) 2017 Derek Gustafson <degustaf@gmail.com>
# Copyright (c) 2017 Ville Skyttä <ville.skytta@iki.fi>
# Copyright (c) 2018-2019, 2021 Nick Drozd <nicholasdrozd@gmail.com>
# Copyright (c) 2018 Pablo Galindo <Pablogsal@gmail.com>
# Copyright (c) 2018 Jim Robertson <jrobertson98atx@gmail.com>
Expand All @@ -42,9 +42,10 @@
# Copyright (c) 2020 Ram Rachum <ram@rachum.com>
# Copyright (c) 2020 Anthony Sottile <asottile@umich.edu>
# Copyright (c) 2020 Anubhav <35621759+anubh-v@users.noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Copyright (c) 2021 Tushar Sadhwani <tushar.sadhwani000@gmail.com>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 David Liu <david@cs.toronto.edu>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Copyright (c) 2021 doranid <ddandd@gmail.com>
# Copyright (c) 2021 yushao2 <36848472+yushao2@users.noreply.github.com>
# Copyright (c) 2021 Andrew Haigh <nelfin@gmail.com>
Expand Down
2 changes: 2 additions & 0 deletions pylint/checkers/unsupported_version.py
@@ -1,3 +1,5 @@
# Copyright (c) 2021 Pierre Sassoulas <pierre.sassoulas@gmail.com>
# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>

# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Expand Down
7 changes: 6 additions & 1 deletion pylint/checkers/utils.py
Expand Up @@ -42,8 +42,13 @@
# Copyright (c) 2020 Slavfox <slavfoxman@gmail.com>
# Copyright (c) 2020 Anthony Sottile <asottile@umich.edu>
# Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com>
# Copyright (c) 2021 Nick Drozd <nicholasdrozd@gmail.com>
# Copyright (c) 2021 Arianna Y <92831762+areveny@users.noreply.github.com>
# Copyright (c) 2021 Jaehoon Hwang <jaehoonhwang@users.noreply.github.com>
# Copyright (c) 2021 Samuel FORESTIER <HorlogeSkynet@users.noreply.github.com>
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
# Copyright (c) 2021 bot <bot@noreply.github.com>
# Copyright (c) 2021 David Liu <david@cs.toronto.edu>
# Copyright (c) 2021 Matus Valo <matusvalo@users.noreply.github.com>
# Copyright (c) 2021 Lorena B <46202743+lorena-b@users.noreply.github.com>
Expand Down

0 comments on commit 5ac091b

Please sign in to comment.