Skip to content

Commit ee2e635

Browse files
Bump pylint to 2.17.0, update changelog (#8395)
1 parent ca25497 commit ee2e635

38 files changed

+228
-120
lines changed

CONTRIBUTORS.txt

+12-6
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Maintainers
1919
- Jacob Walls <[email protected]>
2020
- Hippo91 <[email protected]>
2121
- Mark Byrne <[email protected]>
22-
- Matus Valo <[email protected]>
2322
- Andreas Finkler <[email protected]>
23+
- Matus Valo <[email protected]>
2424
- Dani Alcala <[email protected]>
2525
- Łukasz Rogalski <[email protected]>
2626
- Ashley Whetter <[email protected]>
@@ -99,6 +99,7 @@ contributors:
9999
- Cezar Elnazli <[email protected]>: deprecated-method
100100
- Joseph Young <[email protected]> (jpy-git)
101101
- Tim Martin <[email protected]>
102+
102103
- Tushar Sadhwani <[email protected]> (tusharsadhwani)
103104
- Nicolas Chauvat <[email protected]>
104105
- orSolocate <[email protected]>
@@ -120,6 +121,8 @@ contributors:
120121
- David Liu <[email protected]> (david-yz-liu)
121122
- Dan Goldsmith <[email protected]>: support for msg-template in HTML reporter.
122123
- Buck Evan <[email protected]>
124+
- Zen Lee <[email protected]>
125+
- Robert Hofer <[email protected]>
123126
- Mariatta Wijaya <[email protected]>
124127
* Added new check `logging-fstring-interpolation`
125128
* Documentation typo fixes
@@ -166,9 +169,9 @@ contributors:
166169
- Andreas Freimuth <[email protected]>: fix indentation checking with tabs
167170
- Alexandru Coman <[email protected]>
168171
- jpkotta <[email protected]>
169-
- Zen Lee <[email protected]>
170172
- Takahide Nojima <[email protected]>
171173
- Taewon D. Kim <[email protected]>
174+
- Stavros Ntentos <[email protected]>
172175
- Sneaky Pete <[email protected]>
173176
- Sergey B Kirpichev <[email protected]>
174177
- Sandro Tosi <[email protected]>: Debian packaging
@@ -189,14 +192,17 @@ contributors:
189192
- Marcus Näslund <[email protected]> (naslundx)
190193
- Marco Pernigotti <[email protected]>
191194
- Marco Forte <[email protected]>
195+
- James Addison <[email protected]>
192196
- Ionel Maries Cristian <[email protected]>
193197
- Gergely Kalmár <[email protected]>
194198
- Damien Baty <[email protected]>
195199
- Benjamin Drung <[email protected]>: contributing Debian Developer
196200
- Anubhav <[email protected]>
197201
- Antonio Quarta <[email protected]>
198202
- Andrew J. Simmons <[email protected]>
203+
- Alexey Pelykh <[email protected]>
199204
205+
- jessebrennan <[email protected]>
200206
- chohner <[email protected]>
201207
- Tiago Honorato <[email protected]>
202208
- Steven M. Vascellaro <[email protected]>
@@ -242,7 +248,6 @@ contributors:
242248
- Tyler Thieding <[email protected]>
243249
- Tobias Hernstig <[email protected]>
244250
- Thomas Grainger <[email protected]>
245-
- Stavros Ntentos <[email protected]>
246251
247252
- Simu Toni <[email protected]>
248253
- Sergei Lebedev <[email protected]>
@@ -272,7 +277,6 @@ contributors:
272277
- Justin Li <[email protected]>
273278
- John Kirkham <[email protected]>
274279
- Jens H. Nielsen <[email protected]>
275-
- James Addison <[email protected]>
276280
- Ioana Tagirta <[email protected]>: fix bad thread instantiation check
277281
- Ikraduya Edian <[email protected]>: Added new checks 'consider-using-generator' and 'use-a-generator'.
278282
- Hugues Bruant <[email protected]>
@@ -286,6 +290,7 @@ contributors:
286290
- Elias Dorneles <[email protected]>: minor adjust to config defaults and docs
287291
- Derek Harland <[email protected]>
288292
- David Pursehouse <[email protected]>
293+
- Dave Bunten <[email protected]>
289294
- Daniel Mouritzen <[email protected]>
290295
- Daniel Miller <[email protected]>
291296
- Christoph Blessing <[email protected]>
@@ -359,6 +364,7 @@ contributors:
359364
* Added --list-msgs-enabled command
360365
- Tomer Chachamu <[email protected]>: simplifiable-if-expression
361366
- Tomasz Magulski <[email protected]>
367+
362368
- Tim Hatch <[email protected]>
363369
- Tim Gates <[email protected]>
364370
- Thomas Benhamou <[email protected]>
@@ -385,13 +391,13 @@ contributors:
385391
386392
- Roman Ivanov <[email protected]>
387393
- Robert Schweizer <[email protected]>
388-
- Robert Hofer <[email protected]>
389394
- Reverb Chu <[email protected]>
390395
- Renat Galimov <[email protected]>
391396
- Rebecca Turner <[email protected]> (9999years)
392397
- Randall Leeds <[email protected]>
393398
- Ramon Saraiva <[email protected]>
394399
- Ramiro Leal-Cavazos <[email protected]> (ramiro050): Fixed bug preventing pylint from working with Emacs tramp
400+
- R. N. West <[email protected]>
395401
- Qwiddle13 <[email protected]>
396402
- Quentin Young <[email protected]>
397403
- Prajwal Borkar <[email protected]>
@@ -506,7 +512,6 @@ contributors:
506512
- Denis Laxalde <[email protected]>
507513
- David Lawson <[email protected]>
508514
- David Cain <[email protected]>
509-
- Dave Bunten <[email protected]>
510515
- Danny Hermes <[email protected]>
511516
- Daniele Procida <[email protected]>
512517
- Daniela Plascencia <[email protected]>
@@ -551,6 +556,7 @@ contributors:
551556
- Andrzej Klajnert <[email protected]>
552557
- Andrew Howe <[email protected]>
553558
- Andres Perez Hortal <[email protected]>
559+
- Andre Hora <[email protected]>
554560
- Alok Singh <[email protected]>
555561
- Allan Chandler <[email protected]> (allanc65)
556562
* Fixed issue 5452, false positive missing-param-doc for multi-line Google-style params

doc/user_guide/checkers/features.rst

+8-6
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ Classes checker Messages
324324
Used when an instance attribute is defined outside the __init__ method.
325325
:subclassed-final-class (W0240): *Class %r is a subclass of a class decorated with typing.final: %r*
326326
Used when a class decorated with typing.final has been subclassed.
327+
:implicit-flag-alias (W0213): *Flag member %(overlap)s shares bit positions with %(sources)s*
328+
Used when multiple integer values declared within an enum.IntFlag class share
329+
a common bit position.
327330
:abstract-method (W0223): *Method %r is abstract in class %r but is not overridden in child class %r*
328331
Used when an abstract method (i.e. raise NotImplementedError) is not
329332
overridden in concrete class.
@@ -742,9 +745,9 @@ Verbatim name of the checker is ``nonascii-checker``.
742745
Nonascii-Checker checker Messages
743746
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
744747
:non-ascii-file-name (W2402): *%s name "%s" contains a non-ASCII character.*
745-
Under python 3.5, PEP 3131 only allows non-ascii identifiers, not file
746-
names.Since Python 3.5, even though Python supports UTF-8 files, some editors
747-
or tools don't.
748+
Under python 3.5, PEP 3131 allows non-ascii identifiers, but not non-ascii
749+
file names.Since Python 3.5, even though Python supports UTF-8 files, some
750+
editors or tools don't.
748751
:non-ascii-name (C2401): *%s name "%s" contains a non-ASCII character, consider renaming it.*
749752
Used when the name contains at least one non-ASCII unicode character. See
750753
https://peps.python.org/pep-0672/#confusing-features for a background why
@@ -1264,9 +1267,8 @@ Unicode Checker checker Messages
12641267
:invalid-unicode-codec (E2501): *UTF-16 and UTF-32 aren't backward compatible. Use UTF-8 instead*
12651268
For compatibility use UTF-8 instead of UTF-16/UTF-32. See also
12661269
https://bugs.python.org/issue1503789 for a history of this issue. And
1267-
https://softwareengineering.stackexchange.com/questions/102205/should-
1268-
utf-16-be-considered-harmful for some possible problems when using UTF-16 for
1269-
instance.
1270+
https://softwareengineering.stackexchange.com/questions/102205/ for some
1271+
possible problems when using UTF-16 for instance.
12701272
:bad-file-encoding (C2503): *PEP8 recommends UTF-8 as encoding for Python files*
12711273
PEP8 recommends UTF-8 default encoding for Python files. See
12721274
https://peps.python.org/pep-0008/#source-file-encoding

doc/user_guide/configuration/all-options.rst

+11-2
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,13 @@ Standard Checkers
499499
**Default:** ``('abc.abstractproperty',)``
500500

501501

502+
--typealias-rgx
503+
"""""""""""""""
504+
*Regular expression matching correct type alias names. If left empty, type alias names will be checked with the set naming style.*
505+
506+
**Default:** ``None``
507+
508+
502509
--typevar-rgx
503510
"""""""""""""
504511
*Regular expression matching correct type variable names. If left empty, type variable names will be checked with the set naming style.*
@@ -589,6 +596,8 @@ Standard Checkers
589596
590597
property-classes = ["abc.abstractproperty"]
591598
599+
# typealias-rgx =
600+
592601
# typevar-rgx =
593602
594603
variable-naming-style = "snake_case"
@@ -624,7 +633,7 @@ Standard Checkers
624633
"""""""""""""""""""
625634
*List of member names, which should be excluded from the protected access warning.*
626635

627-
**Default:** ``('_asdict', '_fields', '_replace', '_source', '_make')``
636+
**Default:** ``('_asdict', '_fields', '_replace', '_source', '_make', 'os._exit')``
628637

629638

630639
--valid-classmethod-first-arg
@@ -656,7 +665,7 @@ Standard Checkers
656665
657666
defining-attr-methods = ["__init__", "__new__", "setUp", "__post_init__"]
658667
659-
exclude-protected = ["_asdict", "_fields", "_replace", "_source", "_make"]
668+
exclude-protected = ["_asdict", "_fields", "_replace", "_source", "_make", "os._exit"]
660669
661670
valid-classmethod-first-arg = ["cls"]
662671

doc/user_guide/messages/messages_overview.rst

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ All messages in the warning category:
252252
warning/global-statement
253253
warning/global-variable-not-assigned
254254
warning/global-variable-undefined
255+
warning/implicit-flag-alias
255256
warning/implicit-str-concat
256257
warning/import-self
257258
warning/inconsistent-quotes

doc/whatsnew/2/2.17/index.rst

+165
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,168 @@ Summary -- Release highlights
1212
=============================
1313

1414
.. towncrier release notes start
15+
16+
What's new in Pylint 2.17.0?
17+
----------------------------
18+
Release date: 2023-03-07
19+
20+
21+
New Features
22+
------------
23+
24+
- `pyreverse` now supports custom color palettes with the `--color-palette`
25+
option.
26+
27+
Closes #6738 (`#6738 <https://github.com/PyCQA/pylint/issues/6738>`_)
28+
29+
- Add ``invalid-name`` check for ``TypeAlias`` names.
30+
31+
Closes #7081. (`#7081 <https://github.com/PyCQA/pylint/issues/7081>`_)
32+
33+
- Accept values of the form ``<class name>.<attribute name>`` for the
34+
``exclude-protected`` list.
35+
36+
Closes #7343 (`#7343 <https://github.com/PyCQA/pylint/issues/7343>`_)
37+
38+
- Add `--version` option to `pyreverse`.
39+
40+
Refs #7851 (`#7851 <https://github.com/PyCQA/pylint/issues/7851>`_)
41+
42+
- Adds new functionality with preferred-modules configuration to detect
43+
submodules.
44+
45+
Refs #7957 (`#7957 <https://github.com/PyCQA/pylint/issues/7957>`_)
46+
47+
- Support implicit namespace packages (PEP 420).
48+
49+
Closes #8154 (`#8154 <https://github.com/PyCQA/pylint/issues/8154>`_)
50+
51+
- Add globbing pattern support for ``--source-roots``.
52+
53+
Closes #8290 (`#8290 <https://github.com/PyCQA/pylint/issues/8290>`_)
54+
55+
- Support globbing pattern when defining which file/directory/module to lint.
56+
57+
Closes #8310 (`#8310 <https://github.com/PyCQA/pylint/issues/8310>`_)
58+
59+
- pylint now supports ``TryStar`` nodes from Python 3.11 and should be fully
60+
compatible with Python 3.11.
61+
62+
Closes #8387 (`#8387 <https://github.com/PyCQA/pylint/issues/8387>`_)
63+
64+
65+
66+
New Checks
67+
----------
68+
69+
- Add a ``bad-chained-comparison`` check that emits a warning when
70+
there is a chained comparison where one expression is semantically
71+
incompatible with the other.
72+
73+
Closes #6559 (`#6559 <https://github.com/PyCQA/pylint/issues/6559>`_)
74+
75+
- Adds an ``implicit-flag-alias`` check that emits a warning when a class
76+
derived from ``enum.IntFlag`` assigns distinct integer values that share
77+
common bit positions.
78+
79+
Refs #8102 (`#8102 <https://github.com/PyCQA/pylint/issues/8102>`_)
80+
81+
82+
83+
False Positives Fixed
84+
---------------------
85+
86+
- Fix various false positives for functions that return directly from
87+
structural pattern matching cases.
88+
89+
Closes #5288 (`#5288 <https://github.com/PyCQA/pylint/issues/5288>`_)
90+
91+
- Fix false positive for ``used-before-assignment`` when
92+
``typing.TYPE_CHECKING`` is used with if/elif/else blocks.
93+
94+
Closes #7574 (`#7574 <https://github.com/PyCQA/pylint/issues/7574>`_)
95+
96+
- Fix false positive for isinstance-second-argument-not-valid-type with union
97+
types.
98+
99+
Closes #8205 (`#8205 <https://github.com/PyCQA/pylint/issues/8205>`_)
100+
101+
- Fix false positive for ``used-before-assignment`` for named expressions
102+
appearing after the first element in a list, tuple, or set.
103+
104+
Closes #8252 (`#8252 <https://github.com/PyCQA/pylint/issues/8252>`_)
105+
106+
- Fix false positive for ``wrong-spelling-in-comment`` with class names in a
107+
python 2 type comment.
108+
109+
Closes #8370 (`#8370 <https://github.com/PyCQA/pylint/issues/8370>`_)
110+
111+
112+
113+
False Negatives Fixed
114+
---------------------
115+
116+
- Fix a false negative for 'missing-parentheses-for-call-in-test' when
117+
inference
118+
failed for the internal of the call as we did not need that information to
119+
raise
120+
correctly.
121+
122+
Refs #8185 (`#8185 <https://github.com/PyCQA/pylint/issues/8185>`_)
123+
124+
- Fix false negative for inconsistent-returns with while-loops.
125+
126+
Closes #8280 (`#8280 <https://github.com/PyCQA/pylint/issues/8280>`_)
127+
128+
129+
130+
Other Bug Fixes
131+
---------------
132+
133+
- Fix ``used-before-assignment`` false positive when the walrus operator
134+
is used with a ternary operator in dictionary key/value initialization.
135+
136+
Closes #8125 (`#8125 <https://github.com/PyCQA/pylint/issues/8125>`_)
137+
138+
- Fix ``no-name-in-module`` false positive raised when a package defines a
139+
variable with the
140+
same name as one of its submodules.
141+
142+
Closes #8148 (`#8148 <https://github.com/PyCQA/pylint/issues/8148>`_)
143+
144+
- Fix a crash happening for python interpreter < 3.9 following a failed typing
145+
update.
146+
147+
Closes #8161 (`#8161 <https://github.com/PyCQA/pylint/issues/8161>`_)
148+
149+
- Fix ``nested-min-max`` suggestion message to indicate it's possible to splat
150+
iterable objects.
151+
152+
Closes #8168 (`#8168 <https://github.com/PyCQA/pylint/issues/8168>`_)
153+
154+
- Fix a crash happening when a class attribute was negated in the start
155+
argument of an enumerate.
156+
157+
Closes #8207 (`#8207 <https://github.com/PyCQA/pylint/issues/8207>`_)
158+
159+
- Prevent emitting ``invalid-name`` for the line on which a ``global``
160+
statement is declared.
161+
162+
Closes #8307 (`#8307 <https://github.com/PyCQA/pylint/issues/8307>`_)
163+
164+
165+
166+
Other Changes
167+
-------------
168+
169+
- Update explanation for ``global-variable-not-assigned`` and add confidence.
170+
171+
Closes #5073 (`#5073 <https://github.com/PyCQA/pylint/issues/5073>`_)
172+
173+
- The governance model and the path to become a maintainer have been documented
174+
as
175+
part of our effort to guarantee that the software supply chain in which
176+
pylint is
177+
included is secure.
178+
179+
Refs #8329 (`#8329 <https://github.com/PyCQA/pylint/issues/8329>`_)

doc/whatsnew/fragments/5073.other

-3
This file was deleted.

doc/whatsnew/fragments/5288.false_positive

-4
This file was deleted.

doc/whatsnew/fragments/6559.new_check

-4
This file was deleted.

doc/whatsnew/fragments/6738.feature

-3
This file was deleted.

doc/whatsnew/fragments/7081.feature

-3
This file was deleted.

doc/whatsnew/fragments/7343.feature

-3
This file was deleted.

0 commit comments

Comments
 (0)