Skip to content

Commit

Permalink
Bump pylint to 2.17.0, update changelog (#8395)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Mar 7, 2023
1 parent ca25497 commit ee2e635
Show file tree
Hide file tree
Showing 38 changed files with 228 additions and 120 deletions.
18 changes: 12 additions & 6 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Maintainers
- Jacob Walls <jacobtylerwalls@gmail.com>
- Hippo91 <guillaume.peillex@gmail.com>
- Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com>
- Matus Valo <matusvalo@users.noreply.github.com>
- Andreas Finkler <3929834+DudeNr33@users.noreply.github.com>
- Matus Valo <matusvalo@users.noreply.github.com>
- Dani Alcala <112832187+clavedeluna@users.noreply.github.com>
- Łukasz Rogalski <rogalski.91@gmail.com>
- Ashley Whetter <ashley@awhetter.co.uk>
Expand Down Expand Up @@ -99,6 +99,7 @@ contributors:
- Cezar Elnazli <cezar.elnazli2@gmail.com>: deprecated-method
- Joseph Young <80432516+jpy-git@users.noreply.github.com> (jpy-git)
- Tim Martin <tim@asymptotic.co.uk>
- Ollie <46904826+ollie-iterators@users.noreply.github.com>
- Tushar Sadhwani <tushar.sadhwani000@gmail.com> (tusharsadhwani)
- Nicolas Chauvat <nicolas.chauvat@logilab.fr>
- orSolocate <38433858+orSolocate@users.noreply.github.com>
Expand All @@ -120,6 +121,8 @@ contributors:
- David Liu <david@cs.toronto.edu> (david-yz-liu)
- Dan Goldsmith <djgoldsmith@googlemail.com>: support for msg-template in HTML reporter.
- Buck Evan <buck.2019@gmail.com>
- Zen Lee <53538590+zenlyj@users.noreply.github.com>
- Robert Hofer <hofrob@protonmail.com>
- Mariatta Wijaya <Mariatta@users.noreply.github.com>
* Added new check `logging-fstring-interpolation`
* Documentation typo fixes
Expand Down Expand Up @@ -166,9 +169,9 @@ contributors:
- Andreas Freimuth <andreas.freimuth@united-bits.de>: fix indentation checking with tabs
- Alexandru Coman <fcoman@bitdefender.com>
- jpkotta <jpkotta@gmail.com>
- Zen Lee <53538590+zenlyj@users.noreply.github.com>
- Takahide Nojima <nozzy123nozzy@gmail.com>
- Taewon D. Kim <kimt33@mcmaster.ca>
- Stavros Ntentos <133706+stdedos@users.noreply.github.com>
- Sneaky Pete <sneakypete81@gmail.com>
- Sergey B Kirpichev <skirpichev@gmail.com>
- Sandro Tosi <sandro.tosi@gmail.com>: Debian packaging
Expand All @@ -189,14 +192,17 @@ contributors:
- Marcus Näslund <naslundx@gmail.com> (naslundx)
- Marco Pernigotti <7657251+mpernigo@users.noreply.github.com>
- Marco Forte <fortemarco.irl@gmail.com>
- James Addison <55152140+jayaddison@users.noreply.github.com>
- Ionel Maries Cristian <contact@ionelmc.ro>
- Gergely Kalmár <gergely.kalmar@logikal.jp>
- Damien Baty <damien.baty@polyconseil.fr>
- Benjamin Drung <benjamin.drung@profitbricks.com>: contributing Debian Developer
- Anubhav <35621759+anubh-v@users.noreply.github.com>
- Antonio Quarta <sgheppy88@gmail.com>
- Andrew J. Simmons <anjsimmo@gmail.com>
- Alexey Pelykh <alexey.pelykh@gmail.com>
- wtracy <afishionado@gmail.com>
- jessebrennan <jesse@jesse.computer>
- chohner <mail@chohner.com>
- Tiago Honorato <61059243+tiagohonorato@users.noreply.github.com>
- Steven M. Vascellaro <svascellaro@gmail.com>
Expand Down Expand Up @@ -242,7 +248,6 @@ contributors:
- Tyler Thieding <tyler@thieding.com>
- Tobias Hernstig <30827238+thernstig@users.noreply.github.com>
- Thomas Grainger <tagrain@gmail.com>
- Stavros Ntentos <133706+stdedos@users.noreply.github.com>
- Smixi <sismixx@hotmail.fr>
- Simu Toni <simutoni@gmail.com>
- Sergei Lebedev <185856+superbobry@users.noreply.github.com>
Expand Down Expand Up @@ -272,7 +277,6 @@ contributors:
- Justin Li <justinnhli@gmail.com>
- John Kirkham <jakirkham@gmail.com>
- Jens H. Nielsen <Jens.Nielsen@microsoft.com>
- James Addison <55152140+jayaddison@users.noreply.github.com>
- Ioana Tagirta <ioana.tagirta@gmail.com>: fix bad thread instantiation check
- Ikraduya Edian <ikraduya@gmail.com>: Added new checks 'consider-using-generator' and 'use-a-generator'.
- Hugues Bruant <hugues.bruant@affirm.com>
Expand All @@ -286,6 +290,7 @@ contributors:
- Elias Dorneles <eliasdorneles@gmail.com>: minor adjust to config defaults and docs
- Derek Harland <derek.harland@finq.co.nz>
- David Pursehouse <david.pursehouse@gmail.com>
- Dave Bunten <dave.bunten@cuanschutz.edu>
- Daniel Mouritzen <dmrtzn@gmail.com>
- Daniel Miller <millerdev@gmail.com>
- Christoph Blessing <33834216+cblessing24@users.noreply.github.com>
Expand Down Expand Up @@ -359,6 +364,7 @@ contributors:
* Added --list-msgs-enabled command
- Tomer Chachamu <tomer.chachamu@gmail.com>: simplifiable-if-expression
- Tomasz Magulski <tomasz@magullab.io>
- Tom <tsarantis@proton.me>
- Tim Hatch <tim@timhatch.com>
- Tim Gates <tim.gates@iress.com>
- Thomas Benhamou <thomas@lightricks.com>
Expand All @@ -385,13 +391,13 @@ contributors:
- Ruro <ruro.ruro@ya.ru>
- Roman Ivanov <me@roivanov.com>
- Robert Schweizer <robert_schweizer@gmx.de>
- Robert Hofer <hofrob@protonmail.com>
- Reverb Chu <reverbc@users.noreply.github.com>
- Renat Galimov <renat2017@gmail.com>
- Rebecca Turner <rbt@sent.as> (9999years)
- Randall Leeds <randall@bleeds.info>
- Ramon Saraiva <ramonsaraiva@gmail.com>
- Ramiro Leal-Cavazos <ramiroleal050@gmail.com> (ramiro050): Fixed bug preventing pylint from working with Emacs tramp
- R. N. West <98110034+rnwst@users.noreply.github.com>
- Qwiddle13 <32040075+Qwiddle13@users.noreply.github.com>
- Quentin Young <qlyoung@users.noreply.github.com>
- Prajwal Borkar <sunnyborkar7777@gmail.com>
Expand Down Expand Up @@ -506,7 +512,6 @@ contributors:
- Denis Laxalde <denis.laxalde@logilab.fr>
- David Lawson <dmrlawson@gmail.com>
- David Cain <davidjosephcain@gmail.com>
- Dave Bunten <ekgto445@gmail.com>
- Danny Hermes <daniel.j.hermes@gmail.com>
- Daniele Procida <daniele@vurt.org>
- Daniela Plascencia <daplascen@gmail.com>
Expand Down Expand Up @@ -551,6 +556,7 @@ contributors:
- Andrzej Klajnert <github@aklajnert.pl>
- Andrew Howe <howeaj@users.noreply.github.com>
- Andres Perez Hortal <andresperezcba@gmail.com>
- Andre Hora <andrehora@users.noreply.github.com>
- Alok Singh <8325708+alok@users.noreply.github.com>
- Allan Chandler <95424144+allanc65@users.noreply.github.com> (allanc65)
* Fixed issue 5452, false positive missing-param-doc for multi-line Google-style params
Expand Down
14 changes: 8 additions & 6 deletions doc/user_guide/checkers/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ Classes checker Messages
Used when an instance attribute is defined outside the __init__ method.
:subclassed-final-class (W0240): *Class %r is a subclass of a class decorated with typing.final: %r*
Used when a class decorated with typing.final has been subclassed.
:implicit-flag-alias (W0213): *Flag member %(overlap)s shares bit positions with %(sources)s*
Used when multiple integer values declared within an enum.IntFlag class share
a common bit position.
:abstract-method (W0223): *Method %r is abstract in class %r but is not overridden in child class %r*
Used when an abstract method (i.e. raise NotImplementedError) is not
overridden in concrete class.
Expand Down Expand Up @@ -742,9 +745,9 @@ Verbatim name of the checker is ``nonascii-checker``.
Nonascii-Checker checker Messages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:non-ascii-file-name (W2402): *%s name "%s" contains a non-ASCII character.*
Under python 3.5, PEP 3131 only allows non-ascii identifiers, not file
names.Since Python 3.5, even though Python supports UTF-8 files, some editors
or tools don't.
Under python 3.5, PEP 3131 allows non-ascii identifiers, but not non-ascii
file names.Since Python 3.5, even though Python supports UTF-8 files, some
editors or tools don't.
:non-ascii-name (C2401): *%s name "%s" contains a non-ASCII character, consider renaming it.*
Used when the name contains at least one non-ASCII unicode character. See
https://peps.python.org/pep-0672/#confusing-features for a background why
Expand Down Expand Up @@ -1264,9 +1267,8 @@ Unicode Checker checker Messages
:invalid-unicode-codec (E2501): *UTF-16 and UTF-32 aren't backward compatible. Use UTF-8 instead*
For compatibility use UTF-8 instead of UTF-16/UTF-32. See also
https://bugs.python.org/issue1503789 for a history of this issue. And
https://softwareengineering.stackexchange.com/questions/102205/should-
utf-16-be-considered-harmful for some possible problems when using UTF-16 for
instance.
https://softwareengineering.stackexchange.com/questions/102205/ for some
possible problems when using UTF-16 for instance.
:bad-file-encoding (C2503): *PEP8 recommends UTF-8 as encoding for Python files*
PEP8 recommends UTF-8 default encoding for Python files. See
https://peps.python.org/pep-0008/#source-file-encoding
Expand Down
13 changes: 11 additions & 2 deletions doc/user_guide/configuration/all-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,13 @@ Standard Checkers
**Default:** ``('abc.abstractproperty',)``


--typealias-rgx
"""""""""""""""
*Regular expression matching correct type alias names. If left empty, type alias names will be checked with the set naming style.*

**Default:** ``None``


--typevar-rgx
"""""""""""""
*Regular expression matching correct type variable names. If left empty, type variable names will be checked with the set naming style.*
Expand Down Expand Up @@ -589,6 +596,8 @@ Standard Checkers
property-classes = ["abc.abstractproperty"]
# typealias-rgx =
# typevar-rgx =
variable-naming-style = "snake_case"
Expand Down Expand Up @@ -624,7 +633,7 @@ Standard Checkers
"""""""""""""""""""
*List of member names, which should be excluded from the protected access warning.*

**Default:** ``('_asdict', '_fields', '_replace', '_source', '_make')``
**Default:** ``('_asdict', '_fields', '_replace', '_source', '_make', 'os._exit')``


--valid-classmethod-first-arg
Expand Down Expand Up @@ -656,7 +665,7 @@ Standard Checkers
defining-attr-methods = ["__init__", "__new__", "setUp", "__post_init__"]
exclude-protected = ["_asdict", "_fields", "_replace", "_source", "_make"]
exclude-protected = ["_asdict", "_fields", "_replace", "_source", "_make", "os._exit"]
valid-classmethod-first-arg = ["cls"]
Expand Down
1 change: 1 addition & 0 deletions doc/user_guide/messages/messages_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ All messages in the warning category:
warning/global-statement
warning/global-variable-not-assigned
warning/global-variable-undefined
warning/implicit-flag-alias
warning/implicit-str-concat
warning/import-self
warning/inconsistent-quotes
Expand Down
165 changes: 165 additions & 0 deletions doc/whatsnew/2/2.17/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,168 @@ Summary -- Release highlights
=============================

.. towncrier release notes start
What's new in Pylint 2.17.0?
----------------------------
Release date: 2023-03-07


New Features
------------

- `pyreverse` now supports custom color palettes with the `--color-palette`
option.

Closes #6738 (`#6738 <https://github.com/PyCQA/pylint/issues/6738>`_)

- Add ``invalid-name`` check for ``TypeAlias`` names.

Closes #7081. (`#7081 <https://github.com/PyCQA/pylint/issues/7081>`_)

- Accept values of the form ``<class name>.<attribute name>`` for the
``exclude-protected`` list.

Closes #7343 (`#7343 <https://github.com/PyCQA/pylint/issues/7343>`_)

- Add `--version` option to `pyreverse`.

Refs #7851 (`#7851 <https://github.com/PyCQA/pylint/issues/7851>`_)

- Adds new functionality with preferred-modules configuration to detect
submodules.

Refs #7957 (`#7957 <https://github.com/PyCQA/pylint/issues/7957>`_)

- Support implicit namespace packages (PEP 420).

Closes #8154 (`#8154 <https://github.com/PyCQA/pylint/issues/8154>`_)

- Add globbing pattern support for ``--source-roots``.

Closes #8290 (`#8290 <https://github.com/PyCQA/pylint/issues/8290>`_)

- Support globbing pattern when defining which file/directory/module to lint.

Closes #8310 (`#8310 <https://github.com/PyCQA/pylint/issues/8310>`_)

- pylint now supports ``TryStar`` nodes from Python 3.11 and should be fully
compatible with Python 3.11.

Closes #8387 (`#8387 <https://github.com/PyCQA/pylint/issues/8387>`_)



New Checks
----------

- Add a ``bad-chained-comparison`` check that emits a warning when
there is a chained comparison where one expression is semantically
incompatible with the other.

Closes #6559 (`#6559 <https://github.com/PyCQA/pylint/issues/6559>`_)

- Adds an ``implicit-flag-alias`` check that emits a warning when a class
derived from ``enum.IntFlag`` assigns distinct integer values that share
common bit positions.

Refs #8102 (`#8102 <https://github.com/PyCQA/pylint/issues/8102>`_)



False Positives Fixed
---------------------

- Fix various false positives for functions that return directly from
structural pattern matching cases.

Closes #5288 (`#5288 <https://github.com/PyCQA/pylint/issues/5288>`_)

- Fix false positive for ``used-before-assignment`` when
``typing.TYPE_CHECKING`` is used with if/elif/else blocks.

Closes #7574 (`#7574 <https://github.com/PyCQA/pylint/issues/7574>`_)

- Fix false positive for isinstance-second-argument-not-valid-type with union
types.

Closes #8205 (`#8205 <https://github.com/PyCQA/pylint/issues/8205>`_)

- Fix false positive for ``used-before-assignment`` for named expressions
appearing after the first element in a list, tuple, or set.

Closes #8252 (`#8252 <https://github.com/PyCQA/pylint/issues/8252>`_)

- Fix false positive for ``wrong-spelling-in-comment`` with class names in a
python 2 type comment.

Closes #8370 (`#8370 <https://github.com/PyCQA/pylint/issues/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 (`#8185 <https://github.com/PyCQA/pylint/issues/8185>`_)

- Fix false negative for inconsistent-returns with while-loops.

Closes #8280 (`#8280 <https://github.com/PyCQA/pylint/issues/8280>`_)



Other Bug Fixes
---------------

- Fix ``used-before-assignment`` false positive when the walrus operator
is used with a ternary operator in dictionary key/value initialization.

Closes #8125 (`#8125 <https://github.com/PyCQA/pylint/issues/8125>`_)

- Fix ``no-name-in-module`` false positive raised when a package defines a
variable with the
same name as one of its submodules.

Closes #8148 (`#8148 <https://github.com/PyCQA/pylint/issues/8148>`_)

- Fix a crash happening for python interpreter < 3.9 following a failed typing
update.

Closes #8161 (`#8161 <https://github.com/PyCQA/pylint/issues/8161>`_)

- Fix ``nested-min-max`` suggestion message to indicate it's possible to splat
iterable objects.

Closes #8168 (`#8168 <https://github.com/PyCQA/pylint/issues/8168>`_)

- Fix a crash happening when a class attribute was negated in the start
argument of an enumerate.

Closes #8207 (`#8207 <https://github.com/PyCQA/pylint/issues/8207>`_)

- Prevent emitting ``invalid-name`` for the line on which a ``global``
statement is declared.

Closes #8307 (`#8307 <https://github.com/PyCQA/pylint/issues/8307>`_)



Other Changes
-------------

- Update explanation for ``global-variable-not-assigned`` and add confidence.

Closes #5073 (`#5073 <https://github.com/PyCQA/pylint/issues/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 (`#8329 <https://github.com/PyCQA/pylint/issues/8329>`_)
3 changes: 0 additions & 3 deletions doc/whatsnew/fragments/5073.other

This file was deleted.

4 changes: 0 additions & 4 deletions doc/whatsnew/fragments/5288.false_positive

This file was deleted.

4 changes: 0 additions & 4 deletions doc/whatsnew/fragments/6559.new_check

This file was deleted.

3 changes: 0 additions & 3 deletions doc/whatsnew/fragments/6738.feature

This file was deleted.

3 changes: 0 additions & 3 deletions doc/whatsnew/fragments/7081.feature

This file was deleted.

3 changes: 0 additions & 3 deletions doc/whatsnew/fragments/7343.feature

This file was deleted.

0 comments on commit ee2e635

Please sign in to comment.