diff --git a/doc/whatsnew/3/3.2/index.rst b/doc/whatsnew/3/3.2/index.rst index e2990f9572..eb488e83c3 100644 --- a/doc/whatsnew/3/3.2/index.rst +++ b/doc/whatsnew/3/3.2/index.rst @@ -12,5 +12,80 @@ Summary -- Release highlights ============================= - .. towncrier release notes start + +What's new in Pylint 3.2.0? +--------------------------- +Release date: 2024-05-14 + + +New Features +------------ + +- Understand `six.PY2` and `six.PY3` for conditional imports. + + Closes #3501 (`#3501 `_) + +- A new `github` reporter has been added. This reporter returns the output of `pylint` in a format that + Github can use to automatically annotate code. Use it with `pylint --output-format=github` on your Github Workflows. + + Closes #9443. (`#9443 `_) + + + +New Checks +---------- + +- Add check ``possibly-used-before-assignment`` when relying on names after an ``if/else`` + switch when one branch failed to define the name, raise, or return. + + Closes #1727 (`#1727 `_) + +- Checks for generators that use contextmanagers that don't handle cleanup properly. + Is meant to raise visibility on the case that a generator is not fully exhausted and the contextmanager is not cleaned up properly. + A contextmanager must yield a non-constant value and not handle cleanup for GeneratorExit. + The using generator must attempt to use the yielded context value `with x() as y` and not just `with x()`. + + Closes #2832 (`#2832 `_) + + + +False Negatives Fixed +--------------------- + +- If and Try nodes are now checked for useless return statements as well. + + Closes #9449. (`#9449 `_) + +- Fix false negative for ``property-with-parameters`` in the case of parameters which are ``positional-only``, ``keyword-only``, ``variadic positional`` or ``variadic keyword``. + + Closes #9584 (`#9584 `_) + +False Positives Fixed +--------------------- + +pylint now understands the ``@overload`` decorator return values better. + +Closes #4696 (`#4696 `_) +Refs #9606 (`#9606 `_) + +Performance Improvements +------------------------ + + +- Ignored modules are now not checked at all, instead of being checked and then + ignored. This should speed up the analysis of large codebases which have + ignored modules. + + Closes #9442 (`#9442 `_) (`#9442 `_) + + +- ImportChecker's logic has been modified to avoid context files when possible. This makes it possible + to cache module searches on astroid and reduce execution times. + + Refs #9310. (`#9310 `_) + +- An internal check for ``trailing-comma-tuple`` being enabled for a file or not is now + done once per file instead of once for each token. + + Refs #9608. (`#9608 `_) diff --git a/doc/whatsnew/fragments/1727.new_check b/doc/whatsnew/fragments/1727.new_check deleted file mode 100644 index 30b5d3442e..0000000000 --- a/doc/whatsnew/fragments/1727.new_check +++ /dev/null @@ -1,4 +0,0 @@ -Add check ``possibly-used-before-assignment`` when relying on names after an ``if/else`` -switch when one branch failed to define the name, raise, or return. - -Closes #1727 diff --git a/doc/whatsnew/fragments/2832.new_check b/doc/whatsnew/fragments/2832.new_check deleted file mode 100644 index 64b38be2e9..0000000000 --- a/doc/whatsnew/fragments/2832.new_check +++ /dev/null @@ -1,6 +0,0 @@ -Checks for generators that use contextmanagers that don't handle cleanup properly. -Is meant to raise visibilty on the case that a generator is not fully exhausted and the contextmanager is not cleaned up properly. -A contextmanager must yield a non-constant value and not handle cleanup for GeneratorExit. -The using generator must attempt to use the yielded context value `with x() as y` and not just `with x()`. - -Closes #2832 diff --git a/doc/whatsnew/fragments/3501.feature b/doc/whatsnew/fragments/3501.feature deleted file mode 100644 index bccd382c8c..0000000000 --- a/doc/whatsnew/fragments/3501.feature +++ /dev/null @@ -1,3 +0,0 @@ -Understand `six.PY2` and `six.PY3` for conditional imports. - -Closes #3501 diff --git a/doc/whatsnew/fragments/9310.performance b/doc/whatsnew/fragments/9310.performance deleted file mode 100644 index d1d126baa1..0000000000 --- a/doc/whatsnew/fragments/9310.performance +++ /dev/null @@ -1,4 +0,0 @@ -ImportChecker's logic has been modified to avoid context files when possible. This makes it possible -to cache module searches on astroid and reduce execution times. - -Refs #9310. diff --git a/doc/whatsnew/fragments/9442.other b/doc/whatsnew/fragments/9442.other deleted file mode 100644 index 9523aba7ff..0000000000 --- a/doc/whatsnew/fragments/9442.other +++ /dev/null @@ -1,5 +0,0 @@ -Ignored modules are now not checked at all, instead of being checked and then -ignored. This should speed up the analysis of large codebases which have -ignored modules. - -Closes #9442 (`#9442 `_) diff --git a/doc/whatsnew/fragments/9443.feature b/doc/whatsnew/fragments/9443.feature deleted file mode 100644 index 9be1209ff2..0000000000 --- a/doc/whatsnew/fragments/9443.feature +++ /dev/null @@ -1,4 +0,0 @@ -A new `github` reporter has been added. This reporter returns the output of `pylint` in a format that -Github can use to automatically annotate code. Use it with `pylint --output-format=github` on your Github Workflows. - -Closes #9443. diff --git a/doc/whatsnew/fragments/9449.false_negative b/doc/whatsnew/fragments/9449.false_negative deleted file mode 100644 index 0c11d515cb..0000000000 --- a/doc/whatsnew/fragments/9449.false_negative +++ /dev/null @@ -1,3 +0,0 @@ -If and Try nodes are now checked for useless return statements as well. - -Closes #9449. diff --git a/doc/whatsnew/fragments/9584.false_negative b/doc/whatsnew/fragments/9584.false_negative deleted file mode 100644 index 41459d6fcc..0000000000 --- a/doc/whatsnew/fragments/9584.false_negative +++ /dev/null @@ -1,3 +0,0 @@ -Fix false negative for ``property-with-parameters`` in the case of parameters which are ``positional-only``, ``keyword-only``, ``variadic positional`` or ``variadic keyword``. - -Closes #9584 diff --git a/doc/whatsnew/fragments/9606.internal b/doc/whatsnew/fragments/9606.internal deleted file mode 100644 index a63efb7bdb..0000000000 --- a/doc/whatsnew/fragments/9606.internal +++ /dev/null @@ -1,3 +0,0 @@ -Update astroid version to 3.2.0. - -Refs #9606 diff --git a/doc/whatsnew/fragments/9608.performance b/doc/whatsnew/fragments/9608.performance deleted file mode 100644 index 3d34f20b45..0000000000 --- a/doc/whatsnew/fragments/9608.performance +++ /dev/null @@ -1,4 +0,0 @@ -An internal check for ``trailing-comma-tuple`` being globally enabled or not is now -done once per file instead of once for each token. - -Refs #9608. diff --git a/examples/pylintrc b/examples/pylintrc index 4685415447..4877208fe7 100644 --- a/examples/pylintrc +++ b/examples/pylintrc @@ -62,8 +62,8 @@ ignore-patterns=^\.# # List of module names for which member attributes should not be checked and # will not be imported (useful for modules/projects where namespaces are # manipulated during runtime and thus existing member attributes cannot be -# deduced by static analysis). It supports qualified module names, as well -# as Unix pattern matching. +# deduced by static analysis). It supports qualified module names, as well as +# Unix pattern matching. ignored-modules= # Python code to execute, usually for sys.path manipulation such as diff --git a/examples/pyproject.toml b/examples/pyproject.toml index 7d9ffe8260..2cd404c269 100644 --- a/examples/pyproject.toml +++ b/examples/pyproject.toml @@ -49,11 +49,11 @@ ignore = ["CVS"] # file locks ignore-patterns = ["^\\.#"] -# List of module names for which member attributes should not be checked and -# will not be imported (useful for modules/projects where namespaces are -# manipulated during runtime and thus existing member attributes cannot be -# deduced by static analysis). It supports qualified module names, as well -# as Unix pattern matching. +# List of module names for which member attributes should not be checked and will +# not be imported (useful for modules/projects where namespaces are manipulated +# during runtime and thus existing member attributes cannot be deduced by static +# analysis). It supports qualified module names, as well as Unix pattern +# matching. # ignored-modules = # Python code to execute, usually for sys.path manipulation such as diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index 141aacb4be..509dea3f94 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -9,7 +9,7 @@ from __future__ import annotations -__version__ = "3.2.0-dev0" +__version__ = "3.2.0" def get_numversion_from_version(v: str) -> tuple[int, int, int]: diff --git a/tbump.toml b/tbump.toml index c440c3473b..8ff0411016 100644 --- a/tbump.toml +++ b/tbump.toml @@ -1,7 +1,7 @@ github_url = "https://github.com/pylint-dev/pylint" [version] -current = "3.2.0-dev0" +current = "3.2.0" regex = ''' ^(?P0|[1-9]\d*) \.