diff --git a/doc/development_guide/contributor_guide/release.rst b/doc/development_guide/contributor_guide/release.rst index 61944b333e..bee6e85673 100644 --- a/doc/development_guide/contributor_guide/release.rst +++ b/doc/development_guide/contributor_guide/release.rst @@ -34,7 +34,7 @@ For example: git commit -am "Upgrade the version to 2.5.0-dev0 following 2.4.0 release" - tbump will have created a new ``What's new in Pylint X.Y+1`` document. - Add it to ``doc/whatsnew/3/index.rst``. Take a look at the examples from ``doc/whatsnew``. + Add it to ``doc/whatsnew/X/index.rst``. Take a look at the examples from ``doc/whatsnew``. Commit that with ``git commit -a --amend``. - Push to a release branch - Open a merge request with the two commits (no one can push directly diff --git a/doc/whatsnew/4/4.0/index.rst b/doc/whatsnew/4/4.0/index.rst index d272e696ec..d4d31f8a0a 100644 --- a/doc/whatsnew/4/4.0/index.rst +++ b/doc/whatsnew/4/4.0/index.rst @@ -7,7 +7,7 @@ :maxdepth: 2 :Release:4.0 -:Date: TBA +:Date: 2025-10-12 Summary -- Release highlights ============================= @@ -73,3 +73,297 @@ and to your liking. .. towncrier release notes start + +What's new in Pylint 4.0.0? +--------------------------- +Release date: 2025-10-12 + + +Breaking Changes +---------------- + +- ``invalid-name`` now distinguishes module-level constants that are assigned only once + from those that are reassigned and now applies ``--variable-rgx`` to the latter. Values + other than literals (lists, sets, objects) can pass against either the constant or + variable regexes (e.g. "LOGGER" or "logger" but not "LoGgEr"). + + Remember that ``--good-names`` or ``--good-names-rgxs`` can be provided to explicitly + allow good names. + + Closes #3585 (`#3585 `_) + +- The unused ``pylintrc`` argument to ``PyLinter.__init__()`` is deprecated + and will be removed. + + Refs #6052 (`#6052 `_) + +- Commented out code blocks such as ``# bar() # TODO: remove dead code`` will no longer emit ``fixme``. + + Refs #9255 (`#9255 `_) + +- ``pyreverse`` ``Run`` was changed to no longer call ``sys.exit()`` in its ``__init__``. + You should now call ``Run(args).run()`` which will return the exit code instead. + Having a class that always raised a ``SystemExit`` exception was considered a bug. + + Normal usage of pyreverse through the CLI will not be affected by this change. + + Refs #9689 (`#9689 `_) + +- The ``suggestion-mode`` option was removed, as pylint now always emits user-friendly hints instead + of false-positive error messages. You should remove it from your conf if it's defined. + + Refs #9962 (`#9962 `_) + +- The ``async.py`` checker module has been renamed to ``async_checker.py`` since ``async`` is a Python keyword + and cannot be imported directly. This allows for better testing and extensibility of the async checker functionality. + + Refs #10071 (`#10071 `_) + +- The message-id of ``continue-in-finally`` was changed from ``E0116`` to ``W0136``. The warning is + now emitted for every Python version since it will raise a syntax warning in Python 3.14. + See `PEP 765 - Disallow return/break/continue that exit a finally block `_. + + Refs #10480 (`#10480 `_) + +- Removed support for ``nmp.NaN`` alias for ``numpy.NaN`` being recognized in ':ref:`nan-comparison`'. Use ``np`` or ``numpy`` instead. + + Refs #10583 (`#10583 `_) + +- Version requirement for ``isort`` has been bumped to >=5.0.0. + The internal compatibility for older ``isort`` versions exposed via ``pylint.utils.IsortDriver`` has + been removed. + + Refs #10637 (`#10637 `_) + + + +New Features +------------ + +- ``comparison-of-constants`` now uses the unicode from the ast instead of reformatting from + the node's values preventing some bad formatting due to ``utf-8`` limitation. The message now uses + ``"`` instead of ``'`` to better work with what the python ast returns. + + Refs #8736 (`#8736 `_) + +- Enhanced pyreverse to properly distinguish between UML relationship types (association, aggregation, composition) based on object ownership semantics. Type annotations without assignment are now treated as associations, parameter assignments as aggregations, and object instantiation as compositions. + + Closes #9045 + Closes #9267 (`#9045 `_) + +- The ``fixme`` check can now search through docstrings as well as comments, by using + ``check-fixme-in-docstring = true`` in the ``[tool.pylint.miscellaneous]`` section. + + Closes #9255 (`#9255 `_) + +- The ``use-implicit-booleaness-not-x`` checks now distinguish between comparisons + used in boolean contexts and those that are not, enabling them to provide more accurate refactoring suggestions. + + Closes #9353 (`#9353 `_) + +- The verbose option now outputs the filenames of the files that have been checked. + Previously, it only included the number of checked and skipped files. + + Closes #9357 (`#9357 `_) + +- colorized reporter now colorizes messages/categories that have been configured as ``fail-on`` in red inverse. + This makes it easier to quickly find the errors that are causing pylint CI job failures. + + Closes #9898 (`#9898 `_) + +- Enhanced support for @property decorator in pyreverse to correctly display return types of annotated properties when generating class diagrams. + + Closes #10057 (`#10057 `_) + +- Add --max-depth option to pyreverse to control diagram complexity. A depth of 0 shows only top-level packages, 1 shows one level of subpackages, etc. + This helps manage visualization of large codebases by limiting the depth of displayed packages and classes. + + Refs #10077 (`#10077 `_) + +- Handle deferred evaluation of annotations in Python 3.14. + + Closes #10149 (`#10149 `_) + +- Enhanced pyreverse to properly detect aggregations for comprehensions (list, dict, set, generator). + + Closes #10236 (`#10236 `_) + +- ``pyreverse``: add support for colorized output when using output format ``mmd`` (MermaidJS) and ``html``. + + Closes #10242 (`#10242 `_) + +- pypy 3.11 is now officially supported. + + Refs #10287 (`#10287 `_) + +- Add support for Python 3.14. + + Refs #10467 (`#10467 `_) + +- Add naming styles for ``ParamSpec`` and ``TypeVarTuple`` that align with the ``TypeVar`` style. + + Refs #10541 (`#10541 `_) + + + +New Checks +---------- + +- Add ``match-statements`` checker and the following message: + ``bare-name-capture-pattern``. + This will emit an error message when a name capture pattern is used in a match statement which would make the remaining patterns unreachable. + This code is a SyntaxError at runtime. + + Closes #7128 (`#7128 `_) + +- Add new check ``async-context-manager-with-regular-with`` to detect async context managers used with regular ``with`` statements instead of ``async with``. + + Refs #10408 (`#10408 `_) + +- Add ``break-in-finally`` warning. Using ``break`` inside the ``finally`` clause + will raise a syntax warning in Python 3.14. + See `PEP 765 - Disallow return/break/continue that exit a finally block `_. + + Refs #10480 (`#10480 `_) + +- Add new checks for invalid uses of class patterns in :keyword:`match`. + + * :ref:`invalid-match-args-definition` is emitted if :py:data:`object.__match_args__` isn't a tuple of strings. + * :ref:`too-many-positional-sub-patterns` if there are more positional sub-patterns than specified in :py:data:`object.__match_args__`. + * :ref:`multiple-class-sub-patterns` if there are multiple sub-patterns for the same attribute. + + Refs #10559 (`#10559 `_) + +- Add additional checks for suboptimal uses of class patterns in :keyword:`match`. + + * :ref:`match-class-bind-self` is emitted if a name is bound to ``self`` instead of + using an ``as`` pattern. + * :ref:`match-class-positional-attributes` is emitted if a class pattern has positional + attributes when keywords could be used. + + Refs #10586 (`#10586 `_) + +- Add a ``consider-math-not-float`` message. ``float("nan")`` and ``float("inf")`` are slower + than their counterpart ``math.inf`` and ``math.nan`` by a factor of 4 (notwithstanding + the initial import of math) and they are also not well typed when using mypy. + This check also catches typos in float calls as a side effect. + + The :ref:`pylint.extensions.code_style` need to be activated for this check to work. + + Refs #10621 (`#10621 `_) + + + +False Positives Fixed +--------------------- + +- Fix a false positive for ``used-before-assignment`` when a variable defined under + an ``if`` and via a named expression (walrus operator) is used later when guarded + under the same ``if`` test. + + Closes #10061 (`#10061 `_) + +- Fix :ref:`no-name-in-module` for members of ``concurrent.futures`` with Python 3.14. + + Closes #10632 (`#10632 `_) + + + +False Negatives Fixed +--------------------- + +- Fix false negative for ``used-before-assignment`` when a ``TYPE_CHECKING`` import is used as a type annotation prior to erroneous usage. + + Refs #8893 (`#8893 `_) + +- Match cases are now counted as edges in the McCabe graph and will increase the complexity accordingly. + + Refs #9667 (`#9667 `_) + +- Check module-level constants with type annotations for ``invalid-name``. + Remember to adjust ``const-naming-style`` or ``const-rgx`` to your liking. + + Closes #9770 (`#9770 `_) + +- Fix false negative where function-redefined (E0102) was not reported for functions with a leading underscore. + + Closes #9894 (`#9894 `_) + +- We now raise a ``logging-too-few-args`` for format string with no + interpolation arguments at all (i.e. for something like ``logging.debug("Awaiting process %s")`` + or ``logging.debug("Awaiting process {pid}")``). Previously we did not raise for such case. + + Closes #9999 (`#9999 `_) + +- Fix false negative for ``used-before-assignment`` when a function is defined inside a ``TYPE_CHECKING`` guard block and used later. + + Closes #10028 (`#10028 `_) + +- Fix a false negative for ``possibly-used-before-assignment`` when a variable is conditionally defined + and later assigned to a type-annotated variable. + + Closes #10421 (`#10421 `_) + +- Fix false negative for ``deprecated-module`` when a ``__import__`` method is used instead of ``import`` sentence. + + Refs #10453 (`#10453 `_) + +- Count match cases for ``too-many-branches`` check. + + Refs #10542 (`#10542 `_) + +- Fix false-negative where :ref:`unused-import` was not reported for names referenced in a preceding ``global`` statement. + + Refs #10633 (`#10633 `_) + + + +Other Bug Fixes +--------------- + +- When displaying unicode with surrogates (or other potential ``UnicodeEncodeError``), + pylint will now display a '?' character (using ``encode(encoding="utf-8", errors="replace")``) + instead of crashing. The functional tests classes are also updated to handle this case. + + Closes #8736. (`#8736 `_) + +- Fixed unidiomatic-typecheck only checking left-hand side. + + Closes #10217 (`#10217 `_) + +- Fix a crash caused by malformed format strings when using ``.format`` with keyword arguments. + + Closes #10282 (`#10282 `_) + +- Fix false positive ``inconsistent-return-statements`` when using ``quit()`` or ``exit()`` functions. + + Closes #10508 (`#10508 `_) + +- Fix a crash in :ref:`nested-min-max` when using ``builtins.min`` or ``builtins.max`` + instead of ``min`` or ``max`` directly. + + Closes #10626 (`#10626 `_) + +- Fixed a crash in :ref:`unnecessary-dict-index-lookup` when the index of an enumerated list + was deleted inside a for loop. + + Closes #10627 (`#10627 `_) + + + +Other Changes +------------- + +- Remove support for launching pylint with Python 3.9. + Code that supports Python 3.9 can still be linted with the ``--py-version=3.9`` setting. + + Refs #10405 (`#10405 `_) + + + +Internal Changes +---------------- + +- Modified test framework to allow for different test output for different Python versions. + + Refs #10382 (`#10382 `_) diff --git a/doc/whatsnew/4/4.1/index.rst b/doc/whatsnew/4/4.1/index.rst new file mode 100644 index 0000000000..3e252b4782 --- /dev/null +++ b/doc/whatsnew/4/4.1/index.rst @@ -0,0 +1,16 @@ + +*************************** + What's New in Pylint 4.1 +*************************** + +.. toctree:: + :maxdepth: 2 + +:Release:4.1 +:Date: TBA + +Summary -- Release highlights +============================= + + +.. towncrier release notes start diff --git a/doc/whatsnew/4/index.rst b/doc/whatsnew/4/index.rst index 6572710990..15f966fc69 100644 --- a/doc/whatsnew/4/index.rst +++ b/doc/whatsnew/4/index.rst @@ -6,4 +6,5 @@ This is the full list of change in pylint 4.x minors, by categories. .. toctree:: :maxdepth: 2 + 4.1/index 4.0/index diff --git a/doc/whatsnew/fragments/10028.false_negative b/doc/whatsnew/fragments/10028.false_negative deleted file mode 100644 index eaf356ff6c..0000000000 --- a/doc/whatsnew/fragments/10028.false_negative +++ /dev/null @@ -1,3 +0,0 @@ -Fix false negative for `used-before-assignment` when a function is defined inside a `TYPE_CHECKING` guard block and used later. - -Closes #10028 diff --git a/doc/whatsnew/fragments/10057.feature b/doc/whatsnew/fragments/10057.feature deleted file mode 100644 index 41fd94e5b7..0000000000 --- a/doc/whatsnew/fragments/10057.feature +++ /dev/null @@ -1,3 +0,0 @@ -Enhanced support for @property decorator in pyreverse to correctly display return types of annotated properties when generating class diagrams. - -Closes #10057 diff --git a/doc/whatsnew/fragments/10061.false_positive b/doc/whatsnew/fragments/10061.false_positive deleted file mode 100644 index 9c4bfea0a0..0000000000 --- a/doc/whatsnew/fragments/10061.false_positive +++ /dev/null @@ -1,5 +0,0 @@ -Fix a false positive for `used-before-assignment` when a variable defined under -an `if` and via a named expression (walrus operator) is used later when guarded -under the same `if` test. - -Closes #10061 diff --git a/doc/whatsnew/fragments/10071.breaking b/doc/whatsnew/fragments/10071.breaking deleted file mode 100644 index 7b75760043..0000000000 --- a/doc/whatsnew/fragments/10071.breaking +++ /dev/null @@ -1,4 +0,0 @@ -The ``async.py`` checker module has been renamed to ``async_checker.py`` since ``async`` is a Python keyword -and cannot be imported directly. This allows for better testing and extensibility of the async checker functionality. - -Refs #10071 diff --git a/doc/whatsnew/fragments/10077.feature b/doc/whatsnew/fragments/10077.feature deleted file mode 100644 index b8e748071b..0000000000 --- a/doc/whatsnew/fragments/10077.feature +++ /dev/null @@ -1,4 +0,0 @@ -Add --max-depth option to pyreverse to control diagram complexity. A depth of 0 shows only top-level packages, 1 shows one level of subpackages, etc. -This helps manage visualization of large codebases by limiting the depth of displayed packages and classes. - -Refs #10077 diff --git a/doc/whatsnew/fragments/10149.feature b/doc/whatsnew/fragments/10149.feature deleted file mode 100644 index ed71297170..0000000000 --- a/doc/whatsnew/fragments/10149.feature +++ /dev/null @@ -1,3 +0,0 @@ -Handle deferred evaluation of annotations in Python 3.14. - -Closes #10149 diff --git a/doc/whatsnew/fragments/10217.bugfix b/doc/whatsnew/fragments/10217.bugfix deleted file mode 100644 index b288712aa2..0000000000 --- a/doc/whatsnew/fragments/10217.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Fixed :ref:`unidiomatic-typecheck` only checking left-hand side. - -Closes #10217 diff --git a/doc/whatsnew/fragments/10236.feature b/doc/whatsnew/fragments/10236.feature deleted file mode 100644 index 3a07473f2b..0000000000 --- a/doc/whatsnew/fragments/10236.feature +++ /dev/null @@ -1,3 +0,0 @@ -Enhanced pyreverse to properly detect aggregations for comprehensions (list, dict, set, generator). - -Closes #10236 diff --git a/doc/whatsnew/fragments/10242.feature b/doc/whatsnew/fragments/10242.feature deleted file mode 100644 index 9be0bd25c7..0000000000 --- a/doc/whatsnew/fragments/10242.feature +++ /dev/null @@ -1,3 +0,0 @@ -`pyreverse`: add support for colorized output when using output format `mmd` (MermaidJS) and `html`. - -Closes #10242 diff --git a/doc/whatsnew/fragments/10282.bugfix b/doc/whatsnew/fragments/10282.bugfix deleted file mode 100644 index 42f75bf0ee..0000000000 --- a/doc/whatsnew/fragments/10282.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Fix a crash caused by malformed format strings when using `.format` with keyword arguments. - -Closes #10282 diff --git a/doc/whatsnew/fragments/10287.feature b/doc/whatsnew/fragments/10287.feature deleted file mode 100644 index d71591398c..0000000000 --- a/doc/whatsnew/fragments/10287.feature +++ /dev/null @@ -1,3 +0,0 @@ -pypy 3.11 is now officially supported. - -Refs #10287 diff --git a/doc/whatsnew/fragments/10382.internal b/doc/whatsnew/fragments/10382.internal deleted file mode 100644 index 126aaf8f87..0000000000 --- a/doc/whatsnew/fragments/10382.internal +++ /dev/null @@ -1,3 +0,0 @@ -Modified test framework to allow for different test output for different Python versions. - -Refs #10382 diff --git a/doc/whatsnew/fragments/10405.other b/doc/whatsnew/fragments/10405.other deleted file mode 100644 index 0bdaa73042..0000000000 --- a/doc/whatsnew/fragments/10405.other +++ /dev/null @@ -1,4 +0,0 @@ -Remove support for launching pylint with Python 3.9. -Code that supports Python 3.9 can still be linted with the ``--py-version=3.9`` setting. - -Refs #10405 diff --git a/doc/whatsnew/fragments/10408.new_check b/doc/whatsnew/fragments/10408.new_check deleted file mode 100644 index 5d4dca399b..0000000000 --- a/doc/whatsnew/fragments/10408.new_check +++ /dev/null @@ -1,3 +0,0 @@ -Add new check ``async-context-manager-with-regular-with`` to detect async context managers used with regular ``with`` statements instead of ``async with``. - -Refs #10408 diff --git a/doc/whatsnew/fragments/10421.false_negative b/doc/whatsnew/fragments/10421.false_negative deleted file mode 100644 index 0d79b1a681..0000000000 --- a/doc/whatsnew/fragments/10421.false_negative +++ /dev/null @@ -1,4 +0,0 @@ -Fix a false negative for `possibly-used-before-assignment` when a variable is conditionally defined -and later assigned to a type-annotated variable. - -Closes #10421 diff --git a/doc/whatsnew/fragments/10453.false_negative b/doc/whatsnew/fragments/10453.false_negative deleted file mode 100644 index 1617de29b8..0000000000 --- a/doc/whatsnew/fragments/10453.false_negative +++ /dev/null @@ -1,3 +0,0 @@ -Fix false negative for `deprecated-module` when a `__import__` method is used instead of `import` sentence. - -Refs #10453 diff --git a/doc/whatsnew/fragments/10467.feature b/doc/whatsnew/fragments/10467.feature deleted file mode 100644 index b452fd4dea..0000000000 --- a/doc/whatsnew/fragments/10467.feature +++ /dev/null @@ -1,3 +0,0 @@ -Add support for Python 3.14. - -Refs #10467 diff --git a/doc/whatsnew/fragments/10480.breaking b/doc/whatsnew/fragments/10480.breaking deleted file mode 100644 index 42b0272581..0000000000 --- a/doc/whatsnew/fragments/10480.breaking +++ /dev/null @@ -1,5 +0,0 @@ -The message-id of ``continue-in-finally`` was changed from ``E0116`` to ``W0136``. The warning is -now emitted for every Python version since it will raise a syntax warning in Python 3.14. -See `PEP 765 - Disallow return/break/continue that exit a finally block `_. - -Refs #10480 diff --git a/doc/whatsnew/fragments/10480.new_check b/doc/whatsnew/fragments/10480.new_check deleted file mode 100644 index e25adeccb1..0000000000 --- a/doc/whatsnew/fragments/10480.new_check +++ /dev/null @@ -1,5 +0,0 @@ -Add ``break-in-finally`` warning. Using ``break`` inside the ``finally`` clause -will raise a syntax warning in Python 3.14. -See `PEP 765 - Disallow return/break/continue that exit a finally block `_. - -Refs #10480 diff --git a/doc/whatsnew/fragments/10508.bugfix b/doc/whatsnew/fragments/10508.bugfix deleted file mode 100644 index 3195b4d441..0000000000 --- a/doc/whatsnew/fragments/10508.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Fix false positive ``inconsistent-return-statements`` when using ``quit()`` or ``exit()`` functions. - -Closes #10508 diff --git a/doc/whatsnew/fragments/10541.feature b/doc/whatsnew/fragments/10541.feature deleted file mode 100644 index 5c95cef202..0000000000 --- a/doc/whatsnew/fragments/10541.feature +++ /dev/null @@ -1,3 +0,0 @@ -Add naming styles for ParamSpec and TypeVarTuples which align with the TypeVar style. - -Refs #10541 diff --git a/doc/whatsnew/fragments/10542.false_negative b/doc/whatsnew/fragments/10542.false_negative deleted file mode 100644 index bd523e53bc..0000000000 --- a/doc/whatsnew/fragments/10542.false_negative +++ /dev/null @@ -1,3 +0,0 @@ -Count match cases for ``too-many-branches`` check. - -Refs #10542 diff --git a/doc/whatsnew/fragments/10559.new_check b/doc/whatsnew/fragments/10559.new_check deleted file mode 100644 index 7cf42563b3..0000000000 --- a/doc/whatsnew/fragments/10559.new_check +++ /dev/null @@ -1,7 +0,0 @@ -Add new checks for invalid uses of class patterns in :keyword:`match`. - -* :ref:`invalid-match-args-definition` is emitted if :py:data:`object.__match_args__` isn't a tuple of strings. -* :ref:`too-many-positional-sub-patterns` if there are more positional sub-patterns than specified in :py:data:`object.__match_args__`. -* :ref:`multiple-class-sub-patterns` if there are multiple sub-patterns for the same attribute. - -Refs #10559 diff --git a/doc/whatsnew/fragments/10583.breaking b/doc/whatsnew/fragments/10583.breaking deleted file mode 100644 index a176eb5d27..0000000000 --- a/doc/whatsnew/fragments/10583.breaking +++ /dev/null @@ -1,3 +0,0 @@ -Removed support for ``nmp.NaN`` alias for ``numpy.NaN`` being recognized in :ref:`nan-comparison`. Use ``np`` or ``numpy`` instead. - -Refs #10583 diff --git a/doc/whatsnew/fragments/10586.new_check b/doc/whatsnew/fragments/10586.new_check deleted file mode 100644 index 4d1e2ae17d..0000000000 --- a/doc/whatsnew/fragments/10586.new_check +++ /dev/null @@ -1,8 +0,0 @@ -Add additional checks for suboptimal uses of class patterns in :keyword:`match`. - -* :ref:`match-class-bind-self` is emitted if a name is bound to ``self`` instead of - using an ``as`` pattern. -* :ref:`match-class-positional-attributes` is emitted if a class pattern has positional - attributes when keywords could be used. - -Refs #10586 diff --git a/doc/whatsnew/fragments/10621.new_check b/doc/whatsnew/fragments/10621.new_check deleted file mode 100644 index 85ecc32d1b..0000000000 --- a/doc/whatsnew/fragments/10621.new_check +++ /dev/null @@ -1,8 +0,0 @@ -Add a ``consider-math-not-float`` message. ``float("nan")`` and ``float("inf")`` are slower -than their counterpart ``math.inf`` and ``math.nan`` by a factor of 4 (notwithstanding -the initial import of math) and they are also not well typed when using mypy. -This check also catches typos in float calls as a side effect. - -The :ref:`pylint.extensions.code_style` need to be activated for this check to work. - -Refs #10621 diff --git a/doc/whatsnew/fragments/10626.bugfix b/doc/whatsnew/fragments/10626.bugfix deleted file mode 100644 index 0f109099da..0000000000 --- a/doc/whatsnew/fragments/10626.bugfix +++ /dev/null @@ -1,4 +0,0 @@ -Fix a crash in :ref:`nested-min-max` when using ``builtins.min`` or ``builtins.max`` -instead of ``min`` or ``max`` directly. - -Closes #10626 diff --git a/doc/whatsnew/fragments/10627.bugfix b/doc/whatsnew/fragments/10627.bugfix deleted file mode 100644 index 1f0507d661..0000000000 --- a/doc/whatsnew/fragments/10627.bugfix +++ /dev/null @@ -1,4 +0,0 @@ -Fixed a crash in :ref:`unnecessary-dict-index-lookup` when the index of an enumerated list -was deleted inside a for loop. - -Closes #10627 diff --git a/doc/whatsnew/fragments/10632.false_positive b/doc/whatsnew/fragments/10632.false_positive deleted file mode 100644 index c3d52d0c63..0000000000 --- a/doc/whatsnew/fragments/10632.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -Fix :ref:`no-name-in-module` for members of ``concurrent.futures`` with Python 3.14. - -Closes #10632 diff --git a/doc/whatsnew/fragments/10633.false_negative b/doc/whatsnew/fragments/10633.false_negative deleted file mode 100644 index 38d8002407..0000000000 --- a/doc/whatsnew/fragments/10633.false_negative +++ /dev/null @@ -1,3 +0,0 @@ -Fix false-negative where :ref:`unused-import` was not reported for names referenced in a preceding ``global`` statement. - -Refs #10633 diff --git a/doc/whatsnew/fragments/10637.breaking b/doc/whatsnew/fragments/10637.breaking deleted file mode 100644 index 8f68b735e6..0000000000 --- a/doc/whatsnew/fragments/10637.breaking +++ /dev/null @@ -1,5 +0,0 @@ -Version requirement for `isort` has been bumped to >=5.0.0. -The internal compatibility for older `isort` versions exposed via `pylint.utils.IsortDriver` has -been removed. - -Refs #10637 diff --git a/doc/whatsnew/fragments/3585.breaking b/doc/whatsnew/fragments/3585.breaking deleted file mode 100644 index 5fe71d274e..0000000000 --- a/doc/whatsnew/fragments/3585.breaking +++ /dev/null @@ -1,9 +0,0 @@ -:ref:`invalid-name` now distinguishes module-level constants that are assigned only once -from those that are reassigned and now applies `--variable-rgx` to the latter. Values -other than literals (lists, sets, objects) can pass against either the constant or -variable regexes (e.g. "LOGGER" or "logger" but not "LoGgEr"). - -Remember that `--good-names` or `--good-names-rgxs` can be provided to explicitly -allow good names. - -Closes #3585 diff --git a/doc/whatsnew/fragments/6052.breaking b/doc/whatsnew/fragments/6052.breaking deleted file mode 100644 index c1c035d712..0000000000 --- a/doc/whatsnew/fragments/6052.breaking +++ /dev/null @@ -1,4 +0,0 @@ -The unused ``pylintrc`` argument to ``PyLinter.__init__()`` is deprecated -and will be removed. - -Refs #6052 diff --git a/doc/whatsnew/fragments/7128.new_check b/doc/whatsnew/fragments/7128.new_check deleted file mode 100644 index 4f39a588f8..0000000000 --- a/doc/whatsnew/fragments/7128.new_check +++ /dev/null @@ -1,6 +0,0 @@ -Add ``match-statements`` checker and the following message: -``bare-name-capture-pattern``. -This will emit an error message when a name capture pattern is used in a match statement which would make the remaining patterns unreachable. -This code is a SyntaxError at runtime. - -Closes #7128 diff --git a/doc/whatsnew/fragments/8736.bugfix b/doc/whatsnew/fragments/8736.bugfix deleted file mode 100644 index d06d04d5ac..0000000000 --- a/doc/whatsnew/fragments/8736.bugfix +++ /dev/null @@ -1,5 +0,0 @@ -When displaying unicode with surrogates (or other potential ``UnicodeEncodeError``), -pylint will now display a '?' character (using ``encode(encoding="utf-8", errors="replace")``) -instead of crashing. The functional tests classes are also updated to handle this case. - -Closes #8736. diff --git a/doc/whatsnew/fragments/8736.feature b/doc/whatsnew/fragments/8736.feature deleted file mode 100644 index 80982e3d04..0000000000 --- a/doc/whatsnew/fragments/8736.feature +++ /dev/null @@ -1,5 +0,0 @@ -``comparison-of-constants`` now use the unicode from the ast instead of reformatting from - the node's values preventing some bad formatting due to ``utf-8`` limitation. The message now use - ``"`` instead of ``'`` to better work with what the python ast returns. - -Refs #8736 diff --git a/doc/whatsnew/fragments/8893.false_negative b/doc/whatsnew/fragments/8893.false_negative deleted file mode 100644 index 5760b384f1..0000000000 --- a/doc/whatsnew/fragments/8893.false_negative +++ /dev/null @@ -1,3 +0,0 @@ -Fix false negative for `used-before-assignment` when a `TYPE_CHECKING` import is used as a type annotation prior to erroneous usage. - -Refs #8893 diff --git a/doc/whatsnew/fragments/9045.feature b/doc/whatsnew/fragments/9045.feature deleted file mode 100644 index c460b4c4c2..0000000000 --- a/doc/whatsnew/fragments/9045.feature +++ /dev/null @@ -1,4 +0,0 @@ -Enhanced pyreverse to properly distinguish between UML relationship types (association, aggregation, composition) based on object ownership semantics. Type annotations without assignment are now treated as associations, parameter assignments as aggregations, and object instantiation as compositions. - -Closes #9045 -Closes #9267 diff --git a/doc/whatsnew/fragments/9255.breaking b/doc/whatsnew/fragments/9255.breaking deleted file mode 100644 index 076b96e05c..0000000000 --- a/doc/whatsnew/fragments/9255.breaking +++ /dev/null @@ -1,3 +0,0 @@ -Commented out code blocks such as ``# bar() # TODO: remove dead code`` will no longer emit ``fixme``. - -Refs #9255 diff --git a/doc/whatsnew/fragments/9255.feature b/doc/whatsnew/fragments/9255.feature deleted file mode 100644 index bc6b1033da..0000000000 --- a/doc/whatsnew/fragments/9255.feature +++ /dev/null @@ -1,4 +0,0 @@ -The `fixme` check can now search through docstrings as well as comments, by using -``check-fixme-in-docstring = true`` in the ``[tool.pylint.miscellaneous]`` section. - -Closes #9255 diff --git a/doc/whatsnew/fragments/9353.feature b/doc/whatsnew/fragments/9353.feature deleted file mode 100644 index d1c6d38d70..0000000000 --- a/doc/whatsnew/fragments/9353.feature +++ /dev/null @@ -1,4 +0,0 @@ -The `use-implicit-booleaness-not-x` checks now distinguish between comparisons -used in boolean contexts and those that are not, enabling them to provide more accurate refactoring suggestions. - -Closes #9353 diff --git a/doc/whatsnew/fragments/9357.feature b/doc/whatsnew/fragments/9357.feature deleted file mode 100644 index fda71dd0aa..0000000000 --- a/doc/whatsnew/fragments/9357.feature +++ /dev/null @@ -1,4 +0,0 @@ -The verbose option now outputs the filenames of the files that have been checked. -Previously, it only included the number of checked and skipped files. - -Closes #9357 diff --git a/doc/whatsnew/fragments/9667.false_negative b/doc/whatsnew/fragments/9667.false_negative deleted file mode 100644 index 3bccd0fe5e..0000000000 --- a/doc/whatsnew/fragments/9667.false_negative +++ /dev/null @@ -1,3 +0,0 @@ -Match cases are now counted as edges in the McCabe graph and will increase the complexity accordingly. - -Refs #9667 diff --git a/doc/whatsnew/fragments/9689.breaking b/doc/whatsnew/fragments/9689.breaking deleted file mode 100644 index 5b175304a5..0000000000 --- a/doc/whatsnew/fragments/9689.breaking +++ /dev/null @@ -1,7 +0,0 @@ -`pyreverse` `Run` was changed to no longer call `sys.exit()` in its `__init__`. -You should now call `Run(args).run()` which will return the exit code instead. -Having a class that always raised a `SystemExit` exception was considered a bug. - -Normal usage of pyreverse through the CLI will not be affected by this change. - -Refs #9689 diff --git a/doc/whatsnew/fragments/9770.false_negative b/doc/whatsnew/fragments/9770.false_negative deleted file mode 100644 index a6df92e631..0000000000 --- a/doc/whatsnew/fragments/9770.false_negative +++ /dev/null @@ -1,4 +0,0 @@ -Check module-level constants with type annotations for ``invalid-name``. -Remember to adjust ``const-naming-style`` or ``const-rgx`` to your liking. - -Closes #9770 diff --git a/doc/whatsnew/fragments/9894.false_negative b/doc/whatsnew/fragments/9894.false_negative deleted file mode 100644 index 2cbcda6bee..0000000000 --- a/doc/whatsnew/fragments/9894.false_negative +++ /dev/null @@ -1,3 +0,0 @@ -Fix false negative where :ref:`function-redefined` was not reported for functions with a leading underscore. - -Closes #9894 diff --git a/doc/whatsnew/fragments/9898.feature b/doc/whatsnew/fragments/9898.feature deleted file mode 100644 index d23462fc82..0000000000 --- a/doc/whatsnew/fragments/9898.feature +++ /dev/null @@ -1,4 +0,0 @@ -colorized reporter now colorizes messages/categories that have been configured as `fail-on` in red inverse. -This makes it easier to quickly find the errors that are causing pylint CI job failures. - -Closes #9898 diff --git a/doc/whatsnew/fragments/9962.breaking b/doc/whatsnew/fragments/9962.breaking deleted file mode 100644 index f3a5e95572..0000000000 --- a/doc/whatsnew/fragments/9962.breaking +++ /dev/null @@ -1,4 +0,0 @@ -The ``suggestion-mode`` option was removed, as pylint now always emits user-friendly hints instead -of false-positive error messages. You should remove it from your conf if it's defined. - -Refs #9962 diff --git a/doc/whatsnew/fragments/9999.false_negative b/doc/whatsnew/fragments/9999.false_negative deleted file mode 100644 index de5a393d6a..0000000000 --- a/doc/whatsnew/fragments/9999.false_negative +++ /dev/null @@ -1,5 +0,0 @@ -We now raise a ``logging-too-few-args`` for format string with no -interpolation arguments at all (i.e. for something like ``logging.debug("Awaiting process %s")`` -or ``logging.debug("Awaiting process {pid}")``). Previously we did not raise for such case. - -Closes #9999 diff --git a/examples/pylintrc b/examples/pylintrc index 9e815d9f32..c0fd3e4d35 100644 --- a/examples/pylintrc +++ b/examples/pylintrc @@ -230,6 +230,11 @@ name-group= # not require a docstring. no-docstring-rgx=^_ +# Regular expression matching correct parameter specification variable names. +# If left empty, parameter specification variable names will be checked with +# the set naming style. +#paramspec-rgx= + # List of decorators that produce properties, such as abc.abstractproperty. Add # to this list to register other decorators that produce valid properties. # These decorators are taken in consideration only for invalid-name. @@ -243,6 +248,10 @@ property-classes=abc.abstractproperty # variable names will be checked with the set naming style. #typevar-rgx= +# Regular expression matching correct type variable tuple names. If left empty, +# type variable tuple names will be checked with the set naming style. +#typevartuple-rgx= + # Naming style matching correct variable names. variable-naming-style=snake_case @@ -340,7 +349,9 @@ indent-after-paren=4 # tab). indent-string=' ' -# Maximum number of characters on a single line. +# Maximum number of characters on a single line. Pylint's default of 100 is +# based on PEP 8's guidance that teams may choose line lengths up to 99 +# characters. max-line-length=100 # Maximum number of lines in a module. @@ -432,9 +443,9 @@ disable=raw-checker-failed, suppressed-message, useless-suppression, deprecated-pragma, - use-symbolic-message-instead, use-implicit-booleaness-not-comparison-to-string, - use-implicit-booleaness-not-comparison-to-zero + use-implicit-booleaness-not-comparison-to-zero, + use-symbolic-message-instead # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/examples/pyproject.toml b/examples/pyproject.toml index 4bbfc0ffa0..98852248b0 100644 --- a/examples/pyproject.toml +++ b/examples/pyproject.toml @@ -202,6 +202,11 @@ module-naming-style = "snake_case" # require a docstring. no-docstring-rgx = "^_" +# Regular expression matching correct parameter specification variable names. If +# left empty, parameter specification variable names will be checked with the set +# naming style. +# paramspec-rgx = + # List of decorators that produce properties, such as abc.abstractproperty. Add # to this list to register other decorators that produce valid properties. These # decorators are taken in consideration only for invalid-name. @@ -215,6 +220,10 @@ property-classes = [ "abc.abstractproperty" ] # variable names will be checked with the set naming style. # typevar-rgx = +# Regular expression matching correct type variable tuple names. If left empty, +# type variable tuple names will be checked with the set naming style. +# typevartuple-rgx = + # Naming style matching correct variable names. variable-naming-style = "snake_case" @@ -298,7 +307,8 @@ indent-after-paren = 4 # tab). indent-string = " " -# Maximum number of characters on a single line. +# Maximum number of characters on a single line. Pylint's default of 100 is based +# on PEP 8's guidance that teams may choose line lengths up to 99 characters. max-line-length = 100 # Maximum number of lines in a module. @@ -377,9 +387,9 @@ disable = [ "suppressed-message", "useless-suppression", "deprecated-pragma", - "use-symbolic-message-instead", "use-implicit-booleaness-not-comparison-to-string", "use-implicit-booleaness-not-comparison-to-zero", + "use-symbolic-message-instead", ] # Enable the message, report, category or checker with the given id(s). You can diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index 9be35c2816..b398157801 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -9,7 +9,7 @@ from __future__ import annotations -__version__ = "4.0.0-dev0" +__version__ = "4.1.0-dev0" def get_numversion_from_version(v: str) -> tuple[int, int, int]: diff --git a/tbump.toml b/tbump.toml index 1c3676be2b..c56641dacf 100644 --- a/tbump.toml +++ b/tbump.toml @@ -1,7 +1,7 @@ github_url = "https://github.com/pylint-dev/pylint" [version] -current = "4.0.0-dev0" +current = "4.1.0-dev0" regex = ''' ^(?P0|[1-9]\d*) \. diff --git a/towncrier.toml b/towncrier.toml index 7fd820374d..b5c5be5515 100644 --- a/towncrier.toml +++ b/towncrier.toml @@ -1,7 +1,7 @@ [tool.towncrier] version = "4.0.0-dev0" directory = "doc/whatsnew/fragments" -filename = "doc/whatsnew/4/4.0/index.rst" +filename = "doc/whatsnew/4/4.1/index.rst" template = "doc/whatsnew/fragments/_template.rst" issue_format = "`#{issue} `_" wrap = false # doesn't wrap links correctly if beginning with indentation