From ee2e63519b15683d8c93626695c97936eb956ebf Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Tue, 7 Mar 2023 22:57:04 +0100 Subject: [PATCH] Bump pylint to 2.17.0, update changelog (#8395) --- CONTRIBUTORS.txt | 18 +- doc/user_guide/checkers/features.rst | 14 +- doc/user_guide/configuration/all-options.rst | 13 +- doc/user_guide/messages/messages_overview.rst | 1 + doc/whatsnew/2/2.17/index.rst | 165 ++++++++++++++++++ doc/whatsnew/fragments/5073.other | 3 - doc/whatsnew/fragments/5288.false_positive | 4 - doc/whatsnew/fragments/6559.new_check | 4 - doc/whatsnew/fragments/6738.feature | 3 - doc/whatsnew/fragments/7081.feature | 3 - doc/whatsnew/fragments/7343.feature | 3 - doc/whatsnew/fragments/7574.false_positive | 4 - doc/whatsnew/fragments/7851.feature | 3 - doc/whatsnew/fragments/7957.feature | 3 - doc/whatsnew/fragments/8102.new_check | 5 - doc/whatsnew/fragments/8125.bugfix | 4 - doc/whatsnew/fragments/8148.bugfix | 4 - doc/whatsnew/fragments/8154.feature | 3 - doc/whatsnew/fragments/8161.bugfix | 3 - doc/whatsnew/fragments/8168.bugfix | 3 - doc/whatsnew/fragments/8185.false_negative | 5 - doc/whatsnew/fragments/8205.false_positive | 3 - doc/whatsnew/fragments/8207.bugfix | 3 - doc/whatsnew/fragments/8252.false_positive | 4 - doc/whatsnew/fragments/8280.false_negative | 3 - doc/whatsnew/fragments/8290.feature | 3 - doc/whatsnew/fragments/8307.bugfix | 3 - doc/whatsnew/fragments/8310.feature | 3 - doc/whatsnew/fragments/8329.other | 5 - doc/whatsnew/fragments/8370.false_positive | 3 - doc/whatsnew/fragments/8387.feature | 3 - examples/pylintrc | 21 +-- examples/pyproject.toml | 12 +- pylint/__pkginfo__.py | 2 +- .../refactoring/refactoring_checker.py | 2 +- pylint/checkers/unicode.py | 2 +- script/.contributors_aliases.json | 6 +- tbump.toml | 2 +- 38 files changed, 228 insertions(+), 120 deletions(-) delete mode 100644 doc/whatsnew/fragments/5073.other delete mode 100644 doc/whatsnew/fragments/5288.false_positive delete mode 100644 doc/whatsnew/fragments/6559.new_check delete mode 100644 doc/whatsnew/fragments/6738.feature delete mode 100644 doc/whatsnew/fragments/7081.feature delete mode 100644 doc/whatsnew/fragments/7343.feature delete mode 100644 doc/whatsnew/fragments/7574.false_positive delete mode 100644 doc/whatsnew/fragments/7851.feature delete mode 100644 doc/whatsnew/fragments/7957.feature delete mode 100644 doc/whatsnew/fragments/8102.new_check delete mode 100644 doc/whatsnew/fragments/8125.bugfix delete mode 100644 doc/whatsnew/fragments/8148.bugfix delete mode 100644 doc/whatsnew/fragments/8154.feature delete mode 100644 doc/whatsnew/fragments/8161.bugfix delete mode 100644 doc/whatsnew/fragments/8168.bugfix delete mode 100644 doc/whatsnew/fragments/8185.false_negative delete mode 100644 doc/whatsnew/fragments/8205.false_positive delete mode 100644 doc/whatsnew/fragments/8207.bugfix delete mode 100644 doc/whatsnew/fragments/8252.false_positive delete mode 100644 doc/whatsnew/fragments/8280.false_negative delete mode 100644 doc/whatsnew/fragments/8290.feature delete mode 100644 doc/whatsnew/fragments/8307.bugfix delete mode 100644 doc/whatsnew/fragments/8310.feature delete mode 100644 doc/whatsnew/fragments/8329.other delete mode 100644 doc/whatsnew/fragments/8370.false_positive delete mode 100644 doc/whatsnew/fragments/8387.feature diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 47e3c05c54..59af3e059f 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -19,8 +19,8 @@ Maintainers - Jacob Walls - Hippo91 - Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> -- Matus Valo - Andreas Finkler <3929834+DudeNr33@users.noreply.github.com> +- Matus Valo - Dani Alcala <112832187+clavedeluna@users.noreply.github.com> - Łukasz Rogalski - Ashley Whetter @@ -99,6 +99,7 @@ contributors: - Cezar Elnazli : deprecated-method - Joseph Young <80432516+jpy-git@users.noreply.github.com> (jpy-git) - Tim Martin +- Ollie <46904826+ollie-iterators@users.noreply.github.com> - Tushar Sadhwani (tusharsadhwani) - Nicolas Chauvat - orSolocate <38433858+orSolocate@users.noreply.github.com> @@ -120,6 +121,8 @@ contributors: - David Liu (david-yz-liu) - Dan Goldsmith : support for msg-template in HTML reporter. - Buck Evan +- Zen Lee <53538590+zenlyj@users.noreply.github.com> +- Robert Hofer - Mariatta Wijaya * Added new check `logging-fstring-interpolation` * Documentation typo fixes @@ -166,9 +169,9 @@ contributors: - Andreas Freimuth : fix indentation checking with tabs - Alexandru Coman - jpkotta -- Zen Lee <53538590+zenlyj@users.noreply.github.com> - Takahide Nojima - Taewon D. Kim +- Stavros Ntentos <133706+stdedos@users.noreply.github.com> - Sneaky Pete - Sergey B Kirpichev - Sandro Tosi : Debian packaging @@ -189,6 +192,7 @@ contributors: - Marcus Näslund (naslundx) - Marco Pernigotti <7657251+mpernigo@users.noreply.github.com> - Marco Forte +- James Addison <55152140+jayaddison@users.noreply.github.com> - Ionel Maries Cristian - Gergely Kalmár - Damien Baty @@ -196,7 +200,9 @@ contributors: - Anubhav <35621759+anubh-v@users.noreply.github.com> - Antonio Quarta - Andrew J. Simmons +- Alexey Pelykh - wtracy +- jessebrennan - chohner - Tiago Honorato <61059243+tiagohonorato@users.noreply.github.com> - Steven M. Vascellaro @@ -242,7 +248,6 @@ contributors: - Tyler Thieding - Tobias Hernstig <30827238+thernstig@users.noreply.github.com> - Thomas Grainger -- Stavros Ntentos <133706+stdedos@users.noreply.github.com> - Smixi - Simu Toni - Sergei Lebedev <185856+superbobry@users.noreply.github.com> @@ -272,7 +277,6 @@ contributors: - Justin Li - John Kirkham - Jens H. Nielsen -- James Addison <55152140+jayaddison@users.noreply.github.com> - Ioana Tagirta : fix bad thread instantiation check - Ikraduya Edian : Added new checks 'consider-using-generator' and 'use-a-generator'. - Hugues Bruant @@ -286,6 +290,7 @@ contributors: - Elias Dorneles : minor adjust to config defaults and docs - Derek Harland - David Pursehouse +- Dave Bunten - Daniel Mouritzen - Daniel Miller - Christoph Blessing <33834216+cblessing24@users.noreply.github.com> @@ -359,6 +364,7 @@ contributors: * Added --list-msgs-enabled command - Tomer Chachamu : simplifiable-if-expression - Tomasz Magulski +- Tom - Tim Hatch - Tim Gates - Thomas Benhamou @@ -385,13 +391,13 @@ contributors: - Ruro - Roman Ivanov - Robert Schweizer -- Robert Hofer - Reverb Chu - Renat Galimov - Rebecca Turner (9999years) - Randall Leeds - Ramon Saraiva - Ramiro Leal-Cavazos (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 - Prajwal Borkar @@ -506,7 +512,6 @@ contributors: - Denis Laxalde - David Lawson - David Cain -- Dave Bunten - Danny Hermes - Daniele Procida - Daniela Plascencia @@ -551,6 +556,7 @@ contributors: - Andrzej Klajnert - Andrew Howe - Andres Perez Hortal +- Andre Hora - 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 diff --git a/doc/user_guide/checkers/features.rst b/doc/user_guide/checkers/features.rst index ee6d0e22ed..9a7c8a4ff4 100644 --- a/doc/user_guide/checkers/features.rst +++ b/doc/user_guide/checkers/features.rst @@ -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. @@ -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 @@ -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 diff --git a/doc/user_guide/configuration/all-options.rst b/doc/user_guide/configuration/all-options.rst index 21c58a057d..13d67c280b 100644 --- a/doc/user_guide/configuration/all-options.rst +++ b/doc/user_guide/configuration/all-options.rst @@ -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.* @@ -589,6 +596,8 @@ Standard Checkers property-classes = ["abc.abstractproperty"] + # typealias-rgx = + # typevar-rgx = variable-naming-style = "snake_case" @@ -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 @@ -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"] diff --git a/doc/user_guide/messages/messages_overview.rst b/doc/user_guide/messages/messages_overview.rst index a1962f8e0c..167802ae25 100644 --- a/doc/user_guide/messages/messages_overview.rst +++ b/doc/user_guide/messages/messages_overview.rst @@ -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 diff --git a/doc/whatsnew/2/2.17/index.rst b/doc/whatsnew/2/2.17/index.rst index 393fb86de7..3197bc7c77 100644 --- a/doc/whatsnew/2/2.17/index.rst +++ b/doc/whatsnew/2/2.17/index.rst @@ -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 `_) + +- Add ``invalid-name`` check for ``TypeAlias`` names. + + Closes #7081. (`#7081 `_) + +- Accept values of the form ``.`` for the + ``exclude-protected`` list. + + Closes #7343 (`#7343 `_) + +- Add `--version` option to `pyreverse`. + + Refs #7851 (`#7851 `_) + +- Adds new functionality with preferred-modules configuration to detect + submodules. + + Refs #7957 (`#7957 `_) + +- Support implicit namespace packages (PEP 420). + + Closes #8154 (`#8154 `_) + +- Add globbing pattern support for ``--source-roots``. + + Closes #8290 (`#8290 `_) + +- Support globbing pattern when defining which file/directory/module to lint. + + Closes #8310 (`#8310 `_) + +- pylint now supports ``TryStar`` nodes from Python 3.11 and should be fully + compatible with Python 3.11. + + Closes #8387 (`#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 `_) + +- 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 `_) + + + +False Positives Fixed +--------------------- + +- Fix various false positives for functions that return directly from + structural pattern matching cases. + + Closes #5288 (`#5288 `_) + +- Fix false positive for ``used-before-assignment`` when + ``typing.TYPE_CHECKING`` is used with if/elif/else blocks. + + Closes #7574 (`#7574 `_) + +- Fix false positive for isinstance-second-argument-not-valid-type with union + types. + + Closes #8205 (`#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 `_) + +- Fix false positive for ``wrong-spelling-in-comment`` with class names in a + python 2 type comment. + + Closes #8370 (`#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 `_) + +- Fix false negative for inconsistent-returns with while-loops. + + Closes #8280 (`#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 `_) + +- 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 `_) + +- Fix a crash happening for python interpreter < 3.9 following a failed typing + update. + + Closes #8161 (`#8161 `_) + +- Fix ``nested-min-max`` suggestion message to indicate it's possible to splat + iterable objects. + + Closes #8168 (`#8168 `_) + +- Fix a crash happening when a class attribute was negated in the start + argument of an enumerate. + + Closes #8207 (`#8207 `_) + +- Prevent emitting ``invalid-name`` for the line on which a ``global`` + statement is declared. + + Closes #8307 (`#8307 `_) + + + +Other Changes +------------- + +- Update explanation for ``global-variable-not-assigned`` and add confidence. + + Closes #5073 (`#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 `_) diff --git a/doc/whatsnew/fragments/5073.other b/doc/whatsnew/fragments/5073.other deleted file mode 100644 index 610bda9fbc..0000000000 --- a/doc/whatsnew/fragments/5073.other +++ /dev/null @@ -1,3 +0,0 @@ -Update explanation for ``global-variable-not-assigned`` and add confidence. - -Closes #5073 diff --git a/doc/whatsnew/fragments/5288.false_positive b/doc/whatsnew/fragments/5288.false_positive deleted file mode 100644 index bdc6966225..0000000000 --- a/doc/whatsnew/fragments/5288.false_positive +++ /dev/null @@ -1,4 +0,0 @@ -Fix various false positives for functions that return directly from -structural pattern matching cases. - -Closes #5288 diff --git a/doc/whatsnew/fragments/6559.new_check b/doc/whatsnew/fragments/6559.new_check deleted file mode 100644 index fa4f146e3d..0000000000 --- a/doc/whatsnew/fragments/6559.new_check +++ /dev/null @@ -1,4 +0,0 @@ -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 diff --git a/doc/whatsnew/fragments/6738.feature b/doc/whatsnew/fragments/6738.feature deleted file mode 100644 index d6895df365..0000000000 --- a/doc/whatsnew/fragments/6738.feature +++ /dev/null @@ -1,3 +0,0 @@ -`pyreverse` now supports custom color palettes with the `--color-palette` option. - -Closes #6738 diff --git a/doc/whatsnew/fragments/7081.feature b/doc/whatsnew/fragments/7081.feature deleted file mode 100644 index 07e3a236ef..0000000000 --- a/doc/whatsnew/fragments/7081.feature +++ /dev/null @@ -1,3 +0,0 @@ -Add ``invalid-name`` check for ``TypeAlias`` names. - -Closes #7081. diff --git a/doc/whatsnew/fragments/7343.feature b/doc/whatsnew/fragments/7343.feature deleted file mode 100644 index 2e9fa83c1c..0000000000 --- a/doc/whatsnew/fragments/7343.feature +++ /dev/null @@ -1,3 +0,0 @@ -Accept values of the form ``.`` for the ``exclude-protected`` list. - -Closes #7343 diff --git a/doc/whatsnew/fragments/7574.false_positive b/doc/whatsnew/fragments/7574.false_positive deleted file mode 100644 index a7b91b4817..0000000000 --- a/doc/whatsnew/fragments/7574.false_positive +++ /dev/null @@ -1,4 +0,0 @@ -Fix false positive for ``used-before-assignment`` when -``typing.TYPE_CHECKING`` is used with if/elif/else blocks. - -Closes #7574 diff --git a/doc/whatsnew/fragments/7851.feature b/doc/whatsnew/fragments/7851.feature deleted file mode 100644 index 36860ae12c..0000000000 --- a/doc/whatsnew/fragments/7851.feature +++ /dev/null @@ -1,3 +0,0 @@ -Add `--version` option to `pyreverse`. - -Refs #7851 diff --git a/doc/whatsnew/fragments/7957.feature b/doc/whatsnew/fragments/7957.feature deleted file mode 100644 index 325f61d136..0000000000 --- a/doc/whatsnew/fragments/7957.feature +++ /dev/null @@ -1,3 +0,0 @@ -Adds new functionality with preferred-modules configuration to detect submodules. - -Refs #7957 diff --git a/doc/whatsnew/fragments/8102.new_check b/doc/whatsnew/fragments/8102.new_check deleted file mode 100644 index 0bffd4addd..0000000000 --- a/doc/whatsnew/fragments/8102.new_check +++ /dev/null @@ -1,5 +0,0 @@ -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 diff --git a/doc/whatsnew/fragments/8125.bugfix b/doc/whatsnew/fragments/8125.bugfix deleted file mode 100644 index bb7860f925..0000000000 --- a/doc/whatsnew/fragments/8125.bugfix +++ /dev/null @@ -1,4 +0,0 @@ -Fix ``used-before-assignment`` false positive when the walrus operator -is used with a ternary operator in dictionary key/value initialization. - -Closes #8125 diff --git a/doc/whatsnew/fragments/8148.bugfix b/doc/whatsnew/fragments/8148.bugfix deleted file mode 100644 index de3c8ab570..0000000000 --- a/doc/whatsnew/fragments/8148.bugfix +++ /dev/null @@ -1,4 +0,0 @@ -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 diff --git a/doc/whatsnew/fragments/8154.feature b/doc/whatsnew/fragments/8154.feature deleted file mode 100644 index 9c46a1c8da..0000000000 --- a/doc/whatsnew/fragments/8154.feature +++ /dev/null @@ -1,3 +0,0 @@ -Support implicit namespace packages (PEP 420). - -Closes #8154 diff --git a/doc/whatsnew/fragments/8161.bugfix b/doc/whatsnew/fragments/8161.bugfix deleted file mode 100644 index 9570991809..0000000000 --- a/doc/whatsnew/fragments/8161.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Fix a crash happening for python interpreter < 3.9 following a failed typing update. - -Closes #8161 diff --git a/doc/whatsnew/fragments/8168.bugfix b/doc/whatsnew/fragments/8168.bugfix deleted file mode 100644 index dd846b7348..0000000000 --- a/doc/whatsnew/fragments/8168.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Fix ``nested-min-max`` suggestion message to indicate it's possible to splat iterable objects. - -Closes #8168 diff --git a/doc/whatsnew/fragments/8185.false_negative b/doc/whatsnew/fragments/8185.false_negative deleted file mode 100644 index 4d2f878cd6..0000000000 --- a/doc/whatsnew/fragments/8185.false_negative +++ /dev/null @@ -1,5 +0,0 @@ -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 diff --git a/doc/whatsnew/fragments/8205.false_positive b/doc/whatsnew/fragments/8205.false_positive deleted file mode 100644 index 6bf596592f..0000000000 --- a/doc/whatsnew/fragments/8205.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -Fix false positive for isinstance-second-argument-not-valid-type with union types. - -Closes #8205 diff --git a/doc/whatsnew/fragments/8207.bugfix b/doc/whatsnew/fragments/8207.bugfix deleted file mode 100644 index fc7001b0c6..0000000000 --- a/doc/whatsnew/fragments/8207.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Fix a crash happening when a class attribute was negated in the start argument of an enumerate. - -Closes #8207 diff --git a/doc/whatsnew/fragments/8252.false_positive b/doc/whatsnew/fragments/8252.false_positive deleted file mode 100644 index 2c449ac36d..0000000000 --- a/doc/whatsnew/fragments/8252.false_positive +++ /dev/null @@ -1,4 +0,0 @@ -Fix false positive for ``used-before-assignment`` for named expressions -appearing after the first element in a list, tuple, or set. - -Closes #8252 diff --git a/doc/whatsnew/fragments/8280.false_negative b/doc/whatsnew/fragments/8280.false_negative deleted file mode 100644 index 848b71d7c9..0000000000 --- a/doc/whatsnew/fragments/8280.false_negative +++ /dev/null @@ -1,3 +0,0 @@ -Fix false negative for inconsistent-returns with while-loops. - -Closes #8280 diff --git a/doc/whatsnew/fragments/8290.feature b/doc/whatsnew/fragments/8290.feature deleted file mode 100644 index 1099518d84..0000000000 --- a/doc/whatsnew/fragments/8290.feature +++ /dev/null @@ -1,3 +0,0 @@ -Add globbing pattern support for ``--source-roots``. - -Closes #8290 diff --git a/doc/whatsnew/fragments/8307.bugfix b/doc/whatsnew/fragments/8307.bugfix deleted file mode 100644 index f86f7b67b8..0000000000 --- a/doc/whatsnew/fragments/8307.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Prevent emitting ``invalid-name`` for the line on which a ``global`` statement is declared. - -Closes #8307 diff --git a/doc/whatsnew/fragments/8310.feature b/doc/whatsnew/fragments/8310.feature deleted file mode 100644 index a835be097c..0000000000 --- a/doc/whatsnew/fragments/8310.feature +++ /dev/null @@ -1,3 +0,0 @@ -Support globbing pattern when defining which file/directory/module to lint. - -Closes #8310 diff --git a/doc/whatsnew/fragments/8329.other b/doc/whatsnew/fragments/8329.other deleted file mode 100644 index 1c22feacd5..0000000000 --- a/doc/whatsnew/fragments/8329.other +++ /dev/null @@ -1,5 +0,0 @@ -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 diff --git a/doc/whatsnew/fragments/8370.false_positive b/doc/whatsnew/fragments/8370.false_positive deleted file mode 100644 index a641ecbbf2..0000000000 --- a/doc/whatsnew/fragments/8370.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -Fix false positive for ``wrong-spelling-in-comment`` with class names in a python 2 type comment. - -Closes #8370 diff --git a/doc/whatsnew/fragments/8387.feature b/doc/whatsnew/fragments/8387.feature deleted file mode 100644 index 2b4df0001f..0000000000 --- a/doc/whatsnew/fragments/8387.feature +++ /dev/null @@ -1,3 +0,0 @@ -pylint now supports ``TryStar`` nodes from Python 3.11 and should be fully compatible with Python 3.11. - -Closes #8387 diff --git a/examples/pylintrc b/examples/pylintrc index 879c1d4f13..70c5ff87c5 100644 --- a/examples/pylintrc +++ b/examples/pylintrc @@ -90,14 +90,15 @@ persistent=yes # the version used to run pylint. py-version=3.10 -# Add paths to the list of the source roots. The source root is an absolute -# path or a path relative to the current working directory used to -# determine a package namespace for modules located under the source root. -source-roots=src,tests - # Discover python modules and packages in the file system subtree. recursive=no +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. +source-roots= + # When enabled, pylint would attempt to guess common misconfiguration and emit # user-friendly hints instead of false-positive error messages. suggestion-mode=yes @@ -233,6 +234,10 @@ no-docstring-rgx=^_ # These decorators are taken in consideration only for invalid-name. property-classes=abc.abstractproperty +# Regular expression matching correct type alias names. If left empty, type +# alias names will be checked with the set naming style. +#typealias-rgx= + # Regular expression matching correct type variable names. If left empty, type # variable names will be checked with the set naming style. #typevar-rgx= @@ -259,11 +264,7 @@ defining-attr-methods=__init__, # List of member names, which should be excluded from the protected access # warning. -exclude-protected=_asdict, - _fields, - _replace, - _source, - _make +exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit # List of valid names for the first argument in a class method. valid-classmethod-first-arg=cls diff --git a/examples/pyproject.toml b/examples/pyproject.toml index 71490d860d..1608d2cbb3 100644 --- a/examples/pyproject.toml +++ b/examples/pyproject.toml @@ -83,6 +83,12 @@ py-version = "3.10" # Discover python modules and packages in the file system subtree. # recursive = +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. +# source-roots = + # When enabled, pylint would attempt to guess common misconfiguration and emit # user-friendly hints instead of false-positive error messages. suggestion-mode = true @@ -200,6 +206,10 @@ no-docstring-rgx = "^_" # decorators are taken in consideration only for invalid-name. property-classes = ["abc.abstractproperty"] +# Regular expression matching correct type alias names. If left empty, type alias +# names will be checked with the set naming style. +# typealias-rgx = + # Regular expression matching correct type variable names. If left empty, type # variable names will be checked with the set naming style. # typevar-rgx = @@ -220,7 +230,7 @@ defining-attr-methods = ["__init__", "__new__", "setUp", "__post_init__"] # List of member names, which should be excluded from the protected access # warning. -exclude-protected = ["_asdict", "_fields", "_replace", "_source", "_make"] +exclude-protected = ["_asdict", "_fields", "_replace", "_source", "_make", "os._exit"] # List of valid names for the first argument in a class method. valid-classmethod-first-arg = ["cls"] diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index 587dcadcb9..4a6eb60901 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -9,7 +9,7 @@ from __future__ import annotations -__version__ = "2.17.0-dev0" +__version__ = "2.17.0" def get_numversion_from_version(v: str) -> tuple[int, int, int]: diff --git a/pylint/checkers/refactoring/refactoring_checker.py b/pylint/checkers/refactoring/refactoring_checker.py index 26877ccdb7..b0a87b4c98 100644 --- a/pylint/checkers/refactoring/refactoring_checker.py +++ b/pylint/checkers/refactoring/refactoring_checker.py @@ -460,7 +460,7 @@ class RefactoringChecker(checkers.BaseTokenChecker): "R1732": ( "Consider using 'with' for resource-allocating operations", "consider-using-with", - "Emitted if a resource-allocating assignment or call may be replaced by a 'with' block." + "Emitted if a resource-allocating assignment or call may be replaced by a 'with' block. " "By using 'with' the release of the allocated resources is ensured even in the case " "of an exception.", ), diff --git a/pylint/checkers/unicode.py b/pylint/checkers/unicode.py index 3e2bccfa5c..c7e011b6fe 100644 --- a/pylint/checkers/unicode.py +++ b/pylint/checkers/unicode.py @@ -330,7 +330,7 @@ class UnicodeChecker(checkers.BaseRawFileChecker): "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/" + "https://softwareengineering.stackexchange.com/questions/102205/ " "for some possible problems when using UTF-16 for instance." ), ), diff --git a/script/.contributors_aliases.json b/script/.contributors_aliases.json index 64a8ca377b..7a3c4e04b9 100644 --- a/script/.contributors_aliases.json +++ b/script/.contributors_aliases.json @@ -345,6 +345,10 @@ "mails": ["daniel.werner@scalableminds.com"], "name": "Daniel Werner" }, + "dave.bunten@cuanschutz.edu": { + "mails": ["dave.bunten@cuanschutz.edu", "ekgto445@gmail.com"], + "name": "Dave Bunten" + }, "david.douard@sdfa3.org": { "mails": ["david.douard@sdfa3.org", "david.douard@logilab.fr"], "name": "David Douard" @@ -506,7 +510,7 @@ "name": "Steven Myint" }, "hofrob@protonmail.com": { - "mails": ["hofrob@protonmail.com"], + "mails": ["hofrob@protonmail.com", "1058012+hofrob@users.noreply.github.com"], "name": "Robert Hofer" }, "hugovk@users.noreply.github.com": { diff --git a/tbump.toml b/tbump.toml index d595878581..a00de02247 100644 --- a/tbump.toml +++ b/tbump.toml @@ -1,7 +1,7 @@ github_url = "https://github.com/PyCQA/pylint" [version] -current = "2.17.0-dev0" +current = "2.17.0" regex = ''' ^(?P0|[1-9]\d*) \.