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 authored 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 <[email protected]>
- Hippo91 <[email protected]>
- Mark Byrne <[email protected]>
- Matus Valo <[email protected]>
- Andreas Finkler <[email protected]>
- Matus Valo <[email protected]>
- Dani Alcala <[email protected]>
- Łukasz Rogalski <[email protected]>
- Ashley Whetter <[email protected]>
Expand Down Expand Up @@ -99,6 +99,7 @@ contributors:
- Cezar Elnazli <[email protected]>: deprecated-method
- Joseph Young <[email protected]> (jpy-git)
- Tim Martin <[email protected]>
- Ollie <[email protected]>
- Tushar Sadhwani <[email protected]> (tusharsadhwani)
- Nicolas Chauvat <[email protected]>
- orSolocate <[email protected]>
Expand All @@ -120,6 +121,8 @@ contributors:
- David Liu <[email protected]> (david-yz-liu)
- Dan Goldsmith <[email protected]>: support for msg-template in HTML reporter.
- Buck Evan <[email protected]>
- Zen Lee <[email protected]>
- Robert Hofer <[email protected]>
- Mariatta Wijaya <[email protected]>
* Added new check `logging-fstring-interpolation`
* Documentation typo fixes
Expand Down Expand Up @@ -166,9 +169,9 @@ contributors:
- Andreas Freimuth <[email protected]>: fix indentation checking with tabs
- Alexandru Coman <[email protected]>
- jpkotta <[email protected]>
- Zen Lee <[email protected]>
- Takahide Nojima <[email protected]>
- Taewon D. Kim <[email protected]>
- Stavros Ntentos <[email protected]>
- Sneaky Pete <[email protected]>
- Sergey B Kirpichev <[email protected]>
- Sandro Tosi <[email protected]>: Debian packaging
Expand All @@ -189,14 +192,17 @@ contributors:
- Marcus Näslund <[email protected]> (naslundx)
- Marco Pernigotti <[email protected]>
- Marco Forte <[email protected]>
- James Addison <[email protected]>
- Ionel Maries Cristian <[email protected]>
- Gergely Kalmár <[email protected]>
- Damien Baty <[email protected]>
- Benjamin Drung <[email protected]>: contributing Debian Developer
- Anubhav <[email protected]>
- Antonio Quarta <[email protected]>
- Andrew J. Simmons <[email protected]>
- Alexey Pelykh <[email protected]>
- wtracy <[email protected]>
- jessebrennan <[email protected]>
- chohner <[email protected]>
- Tiago Honorato <[email protected]>
- Steven M. Vascellaro <[email protected]>
Expand Down Expand Up @@ -242,7 +248,6 @@ contributors:
- Tyler Thieding <[email protected]>
- Tobias Hernstig <[email protected]>
- Thomas Grainger <[email protected]>
- Stavros Ntentos <[email protected]>
- Smixi <[email protected]>
- Simu Toni <[email protected]>
- Sergei Lebedev <[email protected]>
Expand Down Expand Up @@ -272,7 +277,6 @@ contributors:
- Justin Li <[email protected]>
- John Kirkham <[email protected]>
- Jens H. Nielsen <[email protected]>
- James Addison <[email protected]>
- Ioana Tagirta <[email protected]>: fix bad thread instantiation check
- Ikraduya Edian <[email protected]>: Added new checks 'consider-using-generator' and 'use-a-generator'.
- Hugues Bruant <[email protected]>
Expand All @@ -286,6 +290,7 @@ contributors:
- Elias Dorneles <[email protected]>: minor adjust to config defaults and docs
- Derek Harland <[email protected]>
- David Pursehouse <[email protected]>
- Dave Bunten <[email protected]>
- Daniel Mouritzen <[email protected]>
- Daniel Miller <[email protected]>
- Christoph Blessing <[email protected]>
Expand Down Expand Up @@ -359,6 +364,7 @@ contributors:
* Added --list-msgs-enabled command
- Tomer Chachamu <[email protected]>: simplifiable-if-expression
- Tomasz Magulski <[email protected]>
- Tom <[email protected]>
- Tim Hatch <[email protected]>
- Tim Gates <[email protected]>
- Thomas Benhamou <[email protected]>
Expand All @@ -385,13 +391,13 @@ contributors:
- Ruro <[email protected]>
- Roman Ivanov <[email protected]>
- Robert Schweizer <[email protected]>
- Robert Hofer <[email protected]>
- Reverb Chu <[email protected]>
- Renat Galimov <[email protected]>
- Rebecca Turner <[email protected]> (9999years)
- Randall Leeds <[email protected]>
- Ramon Saraiva <[email protected]>
- Ramiro Leal-Cavazos <[email protected]> (ramiro050): Fixed bug preventing pylint from working with Emacs tramp
- R. N. West <[email protected]>
- Qwiddle13 <[email protected]>
- Quentin Young <[email protected]>
- Prajwal Borkar <[email protected]>
Expand Down Expand Up @@ -506,7 +512,6 @@ contributors:
- Denis Laxalde <[email protected]>
- David Lawson <[email protected]>
- David Cain <[email protected]>
- Dave Bunten <[email protected]>
- Danny Hermes <[email protected]>
- Daniele Procida <[email protected]>
- Daniela Plascencia <[email protected]>
Expand Down Expand Up @@ -551,6 +556,7 @@ contributors:
- Andrzej Klajnert <[email protected]>
- Andrew Howe <[email protected]>
- Andres Perez Hortal <[email protected]>
- Andre Hora <[email protected]>
- Alok Singh <[email protected]>
- Allan Chandler <[email protected]> (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.

Loading

0 comments on commit ee2e635

Please sign in to comment.