Skip to content

Commit f6d3d39

Browse files
Bump pylint to 2.12.0, update changelog
Closes pylint-dev#5250
1 parent f84c069 commit f6d3d39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+171
-48
lines changed

ChangeLog

+22-10
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,34 @@
22
Pylint's ChangeLog
33
------------------
44

5+
What's New in Pylint 2.13.0?
6+
============================
7+
Release date: TBA
8+
9+
..
10+
Put new features here and also in 'doc/whatsnew/2.13.rst'
511

612

7-
What's New in Pylint 2.12.0?
13+
..
14+
Insert your changelog randomly, it will reduce merge conflicts
15+
(Ie. not necessarilly at the end)
16+
17+
18+
What's New in Pylint 2.12.1?
819
============================
920
Release date: TBA
1021

1122
..
12-
Put new features here and also in 'doc/whatsnew/2.12.rst'
23+
Put bug fixes that should not wait for a new minor version here
24+
25+
..
26+
Insert your changelog randomly, it will reduce merge conflicts
27+
(Ie. not necessarilly at the end)
28+
29+
30+
What's New in Pylint 2.12.0?
31+
============================
32+
Release date: 2021-11-24
1333

1434
* Upgrade astroid to 2.9.0
1535

@@ -230,14 +250,6 @@ Release date: TBA
230250

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

233-
234-
What's New in Pylint 2.11.2?
235-
============================
236-
Release date: TBA
237-
238-
..
239-
Put bug fixes that should not wait for a new minor version here
240-
241253
* Pyreverse - Add the project root directory to sys.path
242254

243255
Closes #2479

doc/whatsnew/2.12.rst

+29-15
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,31 @@
33
***************************
44

55
:Release: 2.12
6-
:Date: TBA
6+
:Date: 2021-11-24
77

88
Summary -- Release highlights
99
=============================
1010

11+
In 2.12, we introduced a new option ``py-version`` that permits to analyse code for a python
12+
version that may differ from your current python interpreter. This does not affect all checkers but
13+
permits, for example, to check for python 3.5 code smells (using f-string's) while using pylint with python 3.6.
14+
The minimum version to run pylint is now 3.6.2, while the last working version for python 3.6.0
15+
and 3.6.1 was pylint 2.9.3.
16+
17+
On top of fixing a lot of false positives and bugs, we also added new default checks, like
18+
``use-implicit-booleaness-not-comparison``, ``overridden-final-method``, and ``useless-with-lock``.
19+
There's also better check for TOML configurations.
20+
21+
Lastly, in addition to the information we already had about start line and start column,
22+
we introduced new information about the end line and end column of messages. This
23+
will permit to have more precise visual clue in IDE like in pylint for vs-code. The default
24+
will stay the same to not break compatibility but it can be retrieved by adding ``end_line``
25+
and ``end_column`` to the ``--msg-template`` option. For better result stick to python 3.8+.
26+
27+
The checker for Yoda conditions is now an extension, you might want to enable it if you were
28+
relying on this check. There's also a new extension checker, ``consider-using-any-or-all`` that
29+
detects for loops that could be replaced by any or all, entirely contributed by @areveny,
30+
welcome to the team !
1131

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

36-
* Fix ``useless-super-delegation`` false positive when default keyword argument is a variable.
37-
38-
* Added new checker ``use-implicit-booleanness``: Emitted when using collection
39-
literals for boolean comparisons
40-
4156
* Added new checker ``use-implicit-booleaness-not-comparison``: Emitted when
4257
collection literal comparison is being used to check for emptiness.
4358

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

49-
* Added configuration option ``exclude-too-few-public-methods`` to allow excluding
50-
classes from the ``min-public-methods`` checker.
51-
52-
Closes #3370
53-
5464
* Added new checker ``useless-with-lock`` to find incorrect usage of with statement and threading module locks.
5565
Emitted when ``with threading.Lock():`` is used instead of ``with lock_instance:``.
5666

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

72-
Removed checkers
73-
================
74-
75-
7682
Extensions
7783
==========
84+
7885
* Added an optional extension ``consider-using-any-or-all``: Emitted when a ``for`` loop only
7986
produces a boolean and could be replaced by ``any`` or ``all`` using a generator. Also suggests
8087
a suitable any/all statement if it is concise.
@@ -96,6 +103,11 @@ Other Changes
96103

97104
Closes #5178
98105

106+
* Added configuration option ``exclude-too-few-public-methods`` to allow excluding
107+
classes from the ``min-public-methods`` checker.
108+
109+
Closes #3370
110+
99111
* Fix ``accept-no-yields-doc`` and ``accept-no-return-doc`` not allowing missing ``yield`` or
100112
``return`` documentation when a docstring is partially correct
101113

@@ -199,6 +211,8 @@ Other Changes
199211

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

214+
* Fix ``useless-super-delegation`` false positive when default keyword argument is a variable.
215+
202216
* Make yn validator case insensitive, to allow for ``True`` and ``False`` in config files.
203217

204218
* The last version compatible with python '3.6.0' and '3.6.1' is pylint '2.9.3'. We did not

doc/whatsnew/2.13.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
***************************
2+
What's New in Pylint 2.13
3+
***************************
4+
5+
:Release: 2.13
6+
:Date: TBA
7+
8+
Summary -- Release highlights
9+
=============================
10+
11+
New checkers
12+
============
13+
14+
Removed checkers
15+
================
16+
17+
Extensions
18+
==========
19+
20+
Other Changes
21+
=============

doc/whatsnew/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ High level descriptions of the most important changes between major Pylint versi
99
.. toctree::
1010
:maxdepth: 1
1111

12+
2.13.rst
1213
2.12.rst
1314
2.11.rst
1415
2.10.rst

pylint/__pkginfo__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
33
from typing import Tuple
44

5-
__version__ = "2.11.2-dev0"
5+
__version__ = "2.12.0"
66

77

88
def get_numversion_from_version(v: str) -> Tuple:

pylint/checkers/base.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# Copyright (c) 2017 Jacques Kvam <[email protected]>
2626
# Copyright (c) 2017 ttenhoeve-aa <[email protected]>
2727
# Copyright (c) 2018-2019, 2021 Nick Drozd <[email protected]>
28-
# Copyright (c) 2018-2019 Ville Skyttä <[email protected]>
28+
# Copyright (c) 2018-2019, 2021 Ville Skyttä <[email protected]>
2929
# Copyright (c) 2018 Sergei Lebedev <[email protected]>
3030
# Copyright (c) 2018 Lucas Cimon <[email protected]>
3131
# Copyright (c) 2018 ssolanki <[email protected]>
@@ -53,7 +53,12 @@
5353
# Copyright (c) 2020 Benny <[email protected]>
5454
# Copyright (c) 2020 Anubhav <[email protected]>
5555
# Copyright (c) 2021 Daniël van Noord <[email protected]>
56+
# Copyright (c) 2021 Tushar Sadhwani <[email protected]>
57+
# Copyright (c) 2021 Tim Martin <[email protected]>
58+
# Copyright (c) 2021 Jaehoon Hwang <[email protected]>
59+
# Copyright (c) 2021 jaydesl <[email protected]>
5660
# Copyright (c) 2021 Marc Mueller <[email protected]>
61+
# Copyright (c) 2021 bot <[email protected]>
5762
# Copyright (c) 2021 Yilei "Dolee" Yang <[email protected]>
5863
# Copyright (c) 2021 Lorena B <[email protected]>
5964
# Copyright (c) 2021 David Liu <[email protected]>

pylint/checkers/base_checker.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# Copyright (c) 2019 Bruno P. Kinoshita <[email protected]>
1313
# Copyright (c) 2020 hippo91 <[email protected]>
1414
# Copyright (c) 2021 Daniël van Noord <[email protected]>
15+
# Copyright (c) 2021 bot <[email protected]>
1516
# Copyright (c) 2021 Marc Mueller <[email protected]>
1617

1718
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

pylint/checkers/classes.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
# Copyright (c) 2016 Moises Lopez <[email protected]>
1717
# Copyright (c) 2016 Jakub Wilk <[email protected]>
1818
# Copyright (c) 2017, 2019-2020 hippo91 <[email protected]>
19+
# Copyright (c) 2018, 2021 Ville Skyttä <[email protected]>
1920
# Copyright (c) 2018, 2020 Anthony Sottile <[email protected]>
2021
# Copyright (c) 2018-2019 Nick Drozd <[email protected]>
2122
# Copyright (c) 2018-2019 Ashley Whetter <[email protected]>
2223
# Copyright (c) 2018 Lucas Cimon <[email protected]>
2324
# Copyright (c) 2018 Bryce Guinta <[email protected]>
2425
# Copyright (c) 2018 ssolanki <[email protected]>
2526
# Copyright (c) 2018 Ben Green <[email protected]>
26-
# Copyright (c) 2018 Ville Skyttä <[email protected]>
2727
# Copyright (c) 2019-2021 Pierre Sassoulas <[email protected]>
2828
# Copyright (c) 2019 mattlbeck <[email protected]>
2929
# Copyright (c) 2019-2020 craig-sh <[email protected]>
@@ -34,10 +34,14 @@
3434
# Copyright (c) 2019 Pascal Corpet <[email protected]>
3535
# Copyright (c) 2020 GergelyKalmar <[email protected]>
3636
# Copyright (c) 2021 Daniël van Noord <[email protected]>
37+
# Copyright (c) 2021 Marc Mueller <[email protected]>
38+
# Copyright (c) 2021 Mark Byrne <[email protected]>
39+
# Copyright (c) 2021 Samuel Freilich <[email protected]>
40+
# Copyright (c) 2021 Nick Pesce <[email protected]>
41+
# Copyright (c) 2021 bot <[email protected]>
3742
# Copyright (c) 2021 yushao2 <[email protected]>
3843
# Copyright (c) 2021 SupImDos <[email protected]>
3944
# Copyright (c) 2021 Kayran Schmidt <[email protected]>
40-
# Copyright (c) 2021 Marc Mueller <[email protected]>
4145
# Copyright (c) 2021 Yu Shao, Pang <[email protected]>
4246
# Copyright (c) 2021 Konstantina Saketou <[email protected]>
4347
# Copyright (c) 2021 James Sinclair <[email protected]>

pylint/checkers/design_analysis.py

+4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
# Copyright (c) 2019 Michael Scott Cuthbert <[email protected]>
1616
# Copyright (c) 2020 hippo91 <[email protected]>
1717
# Copyright (c) 2020 Anthony Sottile <[email protected]>
18+
# Copyright (c) 2021 Mike Fiedler <[email protected]>
19+
# Copyright (c) 2021 Youngsoo Sung <[email protected]>
1820
# Copyright (c) 2021 Daniël van Noord <[email protected]>
21+
# Copyright (c) 2021 bot <[email protected]>
22+
# Copyright (c) 2021 Andrew Haigh <[email protected]>
1923
# Copyright (c) 2021 Melvin <[email protected]>
2024
# Copyright (c) 2021 Rebecca Turner <[email protected]>
2125
# Copyright (c) 2021 Marc Mueller <[email protected]>

pylint/checkers/exceptions.py

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# Copyright (c) 2020 Ram Rachum <[email protected]>
2828
# Copyright (c) 2020 Anthony Sottile <[email protected]>
2929
# Copyright (c) 2021 Daniël van Noord <[email protected]>
30+
# Copyright (c) 2021 Nick Drozd <[email protected]>
3031
# Copyright (c) 2021 Marc Mueller <[email protected]>
3132

3233
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

pylint/checkers/format.py

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
# Copyright (c) 2019 Hugo van Kemenade <[email protected]>
3838
# Copyright (c) 2020 Raphael Gaschignard <[email protected]>
3939
# Copyright (c) 2021 Daniël van Noord <[email protected]>
40+
# Copyright (c) 2021 Tushar Sadhwani <[email protected]>
41+
# Copyright (c) 2021 bot <[email protected]>
42+
# Copyright (c) 2021 Ville Skyttä <[email protected]>
4043
# Copyright (c) 2021 Marc Mueller <[email protected]>
4144

4245
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

pylint/checkers/imports.py

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
# Copyright (c) 2020 Peter Kolbus <[email protected]>
3535
# Copyright (c) 2020 Damien Baty <[email protected]>
3636
# Copyright (c) 2020 Anthony Sottile <[email protected]>
37+
# Copyright (c) 2021 Tushar Sadhwani <[email protected]>
3738
# Copyright (c) 2021 Daniël van Noord <[email protected]>
3839
# Copyright (c) 2021 Marc Mueller <[email protected]>
3940
# Copyright (c) 2021 Will Shanks <[email protected]>

pylint/checkers/logging.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# Copyright (c) 2019 Djailla <[email protected]>
1818
# Copyright (c) 2019 Svet <[email protected]>
1919
# Copyright (c) 2020 Anthony Sottile <[email protected]>
20+
# Copyright (c) 2021 Nick Drozd <[email protected]>
2021
# Copyright (c) 2021 Daniël van Noord <[email protected]>
2122
# Copyright (c) 2021 Marc Mueller <[email protected]>
2223
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

pylint/checkers/raw_metrics.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Copyright (c) 2020-2021 hippo91 <[email protected]>
1111
# Copyright (c) 2020 谭九鼎 <[email protected]>
1212
# Copyright (c) 2021 Daniël van Noord <[email protected]>
13+
# Copyright (c) 2021 bot <[email protected]>
1314
# Copyright (c) 2021 Marc Mueller <[email protected]>
1415

1516
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

pylint/checkers/refactoring/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
# Copyright (c) 2020 lrjball <[email protected]>
3030
# Copyright (c) 2020 Yang Yang <[email protected]>
3131
# Copyright (c) 2020 Anthony Sottile <[email protected]>
32+
# Copyright (c) 2021 Jaehoon Hwang <[email protected]>
3233
# Copyright (c) 2021 Marc Mueller <[email protected]>
3334

3435
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

pylint/checkers/similar.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# Copyright (c) 2020 Eli Fine <[email protected]>
1919
# Copyright (c) 2020 Shiv Venkatasubrahmanyam <[email protected]>
2020
# Copyright (c) 2021 Daniël van Noord <[email protected]>
21+
# Copyright (c) 2021 Ville Skyttä <[email protected]>
2122
# Copyright (c) 2021 Marc Mueller <[email protected]>
2223
# Copyright (c) 2021 Maksym Humetskyi <[email protected]>
2324
# Copyright (c) 2021 bot <[email protected]>

pylint/checkers/spelling.py

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
# Copyright (c) 2020 hippo91 <[email protected]>
1919
# Copyright (c) 2020 Damien Baty <[email protected]>
2020
# Copyright (c) 2021 Daniël van Noord <[email protected]>
21+
# Copyright (c) 2021 Tushar Sadhwani <[email protected]>
22+
# Copyright (c) 2021 Nick Drozd <[email protected]>
2123
# Copyright (c) 2021 Marc Mueller <[email protected]>
2224
# Copyright (c) 2021 bot <[email protected]>
2325
# Copyright (c) 2021 Andreas Finkler <[email protected]>

pylint/checkers/strings.py

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
# Copyright (c) 2020 hippo91 <[email protected]>
2525
# Copyright (c) 2020 谭九鼎 <[email protected]>
2626
# Copyright (c) 2020 Anthony <[email protected]>
27+
# Copyright (c) 2021 Tushar Sadhwani <[email protected]>
28+
# Copyright (c) 2021 Jaehoon Hwang <[email protected]>
2729
# Copyright (c) 2021 Daniël van Noord <[email protected]>
2830
# Copyright (c) 2021 Marc Mueller <[email protected]>
2931
# Copyright (c) 2021 Peter Kolbus <[email protected]>

pylint/checkers/typecheck.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
# Copyright (c) 2016 Jürgen Hermann <[email protected]>
1717
# Copyright (c) 2016 Jakub Wilk <[email protected]>
1818
# Copyright (c) 2016 Filipe Brandenburger <[email protected]>
19+
# Copyright (c) 2017, 2021 Ville Skyttä <[email protected]>
1920
# Copyright (c) 2017-2018, 2020 hippo91 <[email protected]>
2021
# Copyright (c) 2017 Łukasz Rogalski <[email protected]>
2122
# Copyright (c) 2017 Derek Gustafson <[email protected]>
22-
# Copyright (c) 2017 Ville Skyttä <[email protected]>
2323
# Copyright (c) 2018-2019, 2021 Nick Drozd <[email protected]>
2424
# Copyright (c) 2018 Pablo Galindo <[email protected]>
2525
# Copyright (c) 2018 Jim Robertson <[email protected]>
@@ -42,9 +42,10 @@
4242
# Copyright (c) 2020 Ram Rachum <[email protected]>
4343
# Copyright (c) 2020 Anthony Sottile <[email protected]>
4444
# Copyright (c) 2020 Anubhav <[email protected]>
45+
# Copyright (c) 2021 Marc Mueller <[email protected]>
46+
# Copyright (c) 2021 Tushar Sadhwani <[email protected]>
4547
# Copyright (c) 2021 Daniël van Noord <[email protected]>
4648
# Copyright (c) 2021 David Liu <[email protected]>
47-
# Copyright (c) 2021 Marc Mueller <[email protected]>
4849
# Copyright (c) 2021 doranid <[email protected]>
4950
# Copyright (c) 2021 yushao2 <[email protected]>
5051
# Copyright (c) 2021 Andrew Haigh <[email protected]>

pylint/checkers/unsupported_version.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) 2021 Pierre Sassoulas <[email protected]>
2+
# Copyright (c) 2021 Mark Byrne <[email protected]>
13
# Copyright (c) 2021 Daniël van Noord <[email protected]>
24

35
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

pylint/checkers/utils.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@
4242
# Copyright (c) 2020 Slavfox <[email protected]>
4343
# Copyright (c) 2020 Anthony Sottile <[email protected]>
4444
# Copyright (c) 2021 Daniël van Noord <[email protected]>
45-
# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
45+
# Copyright (c) 2021 Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com>
4646
# Copyright (c) 2021 Nick Drozd <[email protected]>
47+
# Copyright (c) 2021 Arianna Y <[email protected]>
48+
# Copyright (c) 2021 Jaehoon Hwang <[email protected]>
49+
# Copyright (c) 2021 Samuel FORESTIER <[email protected]>
50+
# Copyright (c) 2021 Marc Mueller <[email protected]>
51+
# Copyright (c) 2021 bot <[email protected]>
4752
# Copyright (c) 2021 David Liu <[email protected]>
4853
# Copyright (c) 2021 Matus Valo <[email protected]>
4954
# Copyright (c) 2021 Lorena B <[email protected]>

0 commit comments

Comments
 (0)