From ebf1952eb5b4bac46751d91181a62bea4bd6599f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:53:01 +0100 Subject: Don't consider ``Union`` to always be a type alias (#8489) Co-authored-by: Pierre Sassoulas (cherry picked from commit 07127ee75f3456920ff5117cdbaf8697744b6cfc) --- doc/whatsnew/fragments/8487.false_positive | 3 +++ pylint/checkers/base/name_checker/checker.py | 8 +++++++- tests/functional/t/typealias_naming_style_default.py | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 doc/whatsnew/fragments/8487.false_positive diff --git a/doc/whatsnew/fragments/8487.false_positive b/doc/whatsnew/fragments/8487.false_positive new file mode 100644 index 000000000..9ff5e3482 --- /dev/null +++ b/doc/whatsnew/fragments/8487.false_positive @@ -0,0 +1,3 @@ +No longer consider ``Union`` as type annotation as type alias for naming checks. + +Closes #8487 diff --git a/pylint/checkers/base/name_checker/checker.py b/pylint/checkers/base/name_checker/checker.py index 1341edc96..616067d1f 100644 --- a/pylint/checkers/base/name_checker/checker.py +++ b/pylint/checkers/base/name_checker/checker.py @@ -597,7 +597,13 @@ class NameChecker(_BasicChecker): inferred = utils.safe_infer(node) if isinstance(inferred, nodes.ClassDef): if inferred.qname() == ".Union": - return True + # Union is a special case because it can be used as a type alias + # or as a type annotation. We only want to check the former. + assert node is not None + return not ( + isinstance(node.parent, nodes.AnnAssign) + and node.parent.value is not None + ) elif isinstance(inferred, nodes.FunctionDef): if inferred.qname() == "typing.TypeAlias": return True diff --git a/tests/functional/t/typealias_naming_style_default.py b/tests/functional/t/typealias_naming_style_default.py index 45f801521..a2d02c0c6 100644 --- a/tests/functional/t/typealias_naming_style_default.py +++ b/tests/functional/t/typealias_naming_style_default.py @@ -21,3 +21,7 @@ BAD_NAME = Union[int, str] # [invalid-name] _BAD_NAME = Union[int, str] # [invalid-name] __BAD_NAME = Union[int, str] # [invalid-name] ANOTHERBADNAME = Union[int, str] # [invalid-name] + +# Regression tests +# This is not a TypeAlias, and thus shouldn't flag the message +x: Union[str, int] = 42 -- cgit v1.2.1 From d429822d56c392b4be914f94d55807b55efbd705 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 22:21:59 +0200 Subject: Fix `unnecessary-lambda` false positive for lambdas using its parameters in their body (#8498) (#8506) Fixes #8496 (cherry picked from commit b62143611a4713e4729ce9ecb6398f5f94d82f1a) Co-authored-by: cherryblossom <31467609+cherryblossom000@users.noreply.github.com> --- doc/whatsnew/fragments/8496.false_positive | 5 +++++ pylint/checkers/base/basic_checker.py | 8 ++++++++ tests/functional/u/unnecessary/unnecessary_lambda.py | 11 +++++++++++ tests/functional/u/unnecessary/unnecessary_lambda.txt | 2 ++ 4 files changed, 26 insertions(+) create mode 100644 doc/whatsnew/fragments/8496.false_positive diff --git a/doc/whatsnew/fragments/8496.false_positive b/doc/whatsnew/fragments/8496.false_positive new file mode 100644 index 000000000..3ea0fca6c --- /dev/null +++ b/doc/whatsnew/fragments/8496.false_positive @@ -0,0 +1,5 @@ +``unnecessary-lambda`` no longer warns on lambdas which use its parameters in +their body (other than the final arguments), e.g. +``lambda foo: (bar if foo else baz)(foo)``. + +Closes #8496 diff --git a/pylint/checkers/base/basic_checker.py b/pylint/checkers/base/basic_checker.py index 08d582b7f..062e67a97 100644 --- a/pylint/checkers/base/basic_checker.py +++ b/pylint/checkers/base/basic_checker.py @@ -519,6 +519,7 @@ class BasicChecker(_BasicChecker): ) @utils.only_required_for_messages("unnecessary-lambda") + # pylint: disable-next=too-many-return-statements def visit_lambda(self, node: nodes.Lambda) -> None: """Check whether the lambda is suspicious.""" # if the body of the lambda is a call expression with the same @@ -576,6 +577,13 @@ class BasicChecker(_BasicChecker): if arg.name != passed_arg.name: return + # The lambda is necessary if it uses its parameter in the function it is + # calling in the lambda's body + # e.g. lambda foo: (func1 if foo else func2)(foo) + for name in call.func.nodes_of_class(nodes.Name): + if name.lookup(name.name)[0] is node: + return + self.add_message("unnecessary-lambda", line=node.fromlineno, node=node) @utils.only_required_for_messages("dangerous-default-value") diff --git a/tests/functional/u/unnecessary/unnecessary_lambda.py b/tests/functional/u/unnecessary/unnecessary_lambda.py index 3e5ece2b1..82571a444 100644 --- a/tests/functional/u/unnecessary/unnecessary_lambda.py +++ b/tests/functional/u/unnecessary/unnecessary_lambda.py @@ -24,6 +24,12 @@ _ = lambda *args, **kwargs: _ANYARGS(*args, **kwargs) # +1: [unnecessary-lambda] _ = lambda x, y, z, *args, **kwargs: _ANYARGS(x, y, z, *args, **kwargs) +# These don't use their parameters in their body +# +1: [unnecessary-lambda] +_ = lambda x: z(lambda x: x)(x) +# +1: [unnecessary-lambda] +_ = lambda x, y: z(lambda x, y: x + y)(x, y) + # Lambdas that are *not* unnecessary and should *not* trigger warnings. _ = lambda x: x _ = lambda x: x() @@ -50,3 +56,8 @@ _ = lambda: _ANYARGS(func=42) _ = lambda: code().analysis() _ = lambda **kwargs: dict(bar=42, **kwargs) + +# These use the lambda parameters in their body +_ = lambda x: x(x) +_ = lambda x, y: x(x, y) +_ = lambda x: z(lambda y: x + y)(x) diff --git a/tests/functional/u/unnecessary/unnecessary_lambda.txt b/tests/functional/u/unnecessary/unnecessary_lambda.txt index 1cfb149df..87f80872c 100644 --- a/tests/functional/u/unnecessary/unnecessary_lambda.txt +++ b/tests/functional/u/unnecessary/unnecessary_lambda.txt @@ -5,3 +5,5 @@ unnecessary-lambda:19:4:19:33::Lambda may not be necessary:UNDEFINED unnecessary-lambda:21:4:21:39::Lambda may not be necessary:UNDEFINED unnecessary-lambda:23:4:23:53::Lambda may not be necessary:UNDEFINED unnecessary-lambda:25:4:25:71::Lambda may not be necessary:UNDEFINED +unnecessary-lambda:29:4:29:31::Lambda may not be necessary:UNDEFINED +unnecessary-lambda:31:4:31:44::Lambda may not be necessary:UNDEFINED -- cgit v1.2.1 From 4e11693a411433cb03b07fc3a04f2e4151280953 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 22:55:13 +0200 Subject: [Backport maintenance/2.17.x] Allow integers in TypeAlias names. (#8507) Co-authored-by: Stephane Odul <1504511+sodul@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- doc/data/messages/i/invalid-name/details.rst | 10 +++++----- doc/whatsnew/fragments/8485.false_positive | 5 +++++ pylint/checkers/base/name_checker/checker.py | 4 +++- .../functional/t/typealias_naming_style_default.py | 3 +++ .../functional/t/typealias_naming_style_default.txt | 21 +++++++++++---------- 5 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 doc/whatsnew/fragments/8485.false_positive diff --git a/doc/data/messages/i/invalid-name/details.rst b/doc/data/messages/i/invalid-name/details.rst index ad155bc14..7e2090158 100644 --- a/doc/data/messages/i/invalid-name/details.rst +++ b/doc/data/messages/i/invalid-name/details.rst @@ -88,11 +88,11 @@ The following type of names are checked with a predefined pattern: | ``typevar`` | ``T``, ``_CallableT``, ``_T_co``, ``AnyStr``, | ``DICT_T``, ``CALLABLE_T``, ``ENUM_T``, ``DeviceType``, | | | ``DeviceTypeT``, ``IPAddressT`` | ``_StrType`` | +--------------------+-------------------------------------------------------+------------------------------------------------------------+ -| ``typealias`` | ``GoodName``, ``_GoodName``, ``IPAddressType`` and | ``BadNameT``, ``badName``, ``TBadName``, ``TypeBadName`` | -| | other PascalCase variants that don't start with ``T``| | -| | or ``Type``. This is to distinguish them from | | -| | ``typevars``. Note that ``TopName`` is allowed but | | -| | ``TTopName`` isn't. | | +| ``typealias`` | ``GoodName``, ``_GoodName``, ``IPAddressType``, | ``BadNameT``, ``badName``, ``TBadName``, ``TypeBadName``, | +| | ``GoodName2`` and other PascalCase variants that | ``_1BadName`` | +| | don't start with ``T`` or ``Type``. This is to | | +| | distinguish them from ``typevars``. Note that | | +| | ``TopName`` is allowed but ``TTopName`` isn't. | | +--------------------+-------------------------------------------------------+------------------------------------------------------------+ Custom regular expressions diff --git a/doc/whatsnew/fragments/8485.false_positive b/doc/whatsnew/fragments/8485.false_positive new file mode 100644 index 000000000..8eac08b95 --- /dev/null +++ b/doc/whatsnew/fragments/8485.false_positive @@ -0,0 +1,5 @@ +``invalid-name`` now allows for integers in ``typealias`` names: +- now valid: ``Good2Name``, ``GoodName2``. +- still invalid: ``_1BadName``. + +Closes #8485 diff --git a/pylint/checkers/base/name_checker/checker.py b/pylint/checkers/base/name_checker/checker.py index 616067d1f..c2b615a48 100644 --- a/pylint/checkers/base/name_checker/checker.py +++ b/pylint/checkers/base/name_checker/checker.py @@ -41,7 +41,9 @@ DEFAULT_PATTERNS = { "typevar": re.compile( r"^_{0,2}(?!T[A-Z])(?:[A-Z]+|(?:[A-Z]+[a-z]+)+T?(? Date: Sun, 2 Apr 2023 10:02:55 +0200 Subject: Don't use removed function from ``astroid`` (#8525) (#8526) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit f7bd67604f395cd50734b9559acc37ae5d34ce4b) Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> --- pylint/checkers/imports.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index 1ed70d958..ef7fe50cc 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -37,6 +37,12 @@ from pylint.utils.linterstats import LinterStats if TYPE_CHECKING: from pylint.lint import PyLinter +if sys.version_info >= (3, 8): + from functools import cached_property +else: + from astroid.decorators import cachedproperty as cached_property + + # The dictionary with Any should actually be a _ImportTree again # but mypy doesn't support recursive types yet _ImportTree = Dict[str, Union[List[Dict[str, Any]], List[str]]] @@ -997,7 +1003,7 @@ class ImportsChecker(DeprecatedMixin, BaseChecker): self, sect: Section, _: LinterStats, _dummy: LinterStats | None ) -> None: """Return a verbatim layout for displaying dependencies.""" - dep_info = _make_tree_defs(self._external_dependencies_info().items()) + dep_info = _make_tree_defs(self._external_dependencies_info.items()) if not dep_info: raise EmptyReportError() tree_str = _repr_tree_defs(dep_info) @@ -1019,10 +1025,10 @@ class ImportsChecker(DeprecatedMixin, BaseChecker): _make_graph(filename, dep_info, sect, "") filename = self.linter.config.ext_import_graph if filename: - _make_graph(filename, self._external_dependencies_info(), sect, "external ") + _make_graph(filename, self._external_dependencies_info, sect, "external ") filename = self.linter.config.int_import_graph if filename: - _make_graph(filename, self._internal_dependencies_info(), sect, "internal ") + _make_graph(filename, self._internal_dependencies_info, sect, "internal ") def _filter_dependencies_graph(self, internal: bool) -> defaultdict[str, set[str]]: """Build the internal or the external dependency graph.""" @@ -1035,14 +1041,14 @@ class ImportsChecker(DeprecatedMixin, BaseChecker): graph[importee].add(importer) return graph - @astroid.decorators.cached + @cached_property def _external_dependencies_info(self) -> defaultdict[str, set[str]]: """Return cached external dependencies information or build and cache them. """ return self._filter_dependencies_graph(internal=False) - @astroid.decorators.cached + @cached_property def _internal_dependencies_info(self) -> defaultdict[str, set[str]]: """Return cached internal dependencies information or build and cache them. -- cgit v1.2.1 From 6dda042008e69419cdf52192ab699d97e48b05e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 2 Apr 2023 23:13:56 +0200 Subject: [pyreverse] Bugfix: strip "/" at the end of the file (#8517) (#8528) Signed-off-by: Alvaro Frias Garay Co-authored-by: Pierre Sassoulas (cherry picked from commit 6ad17fb758361f50210f4cb5a4fd34494034f4e0) Co-authored-by: Alvaro Frias --- doc/whatsnew/fragments/8504.bugfix | 3 +++ pylint/pyreverse/writer.py | 2 +- tests/pyreverse/test_writer.py | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 doc/whatsnew/fragments/8504.bugfix diff --git a/doc/whatsnew/fragments/8504.bugfix b/doc/whatsnew/fragments/8504.bugfix new file mode 100644 index 000000000..2b54ac7b6 --- /dev/null +++ b/doc/whatsnew/fragments/8504.bugfix @@ -0,0 +1,3 @@ +Fix a crash in pyreverse when "/" characters are used in the output filename e.g pyreverse -o png -p name/ path/to/project. + +Closes #8504 diff --git a/pylint/pyreverse/writer.py b/pylint/pyreverse/writer.py index 3d0a4613a..d92f4e2e5 100644 --- a/pylint/pyreverse/writer.py +++ b/pylint/pyreverse/writer.py @@ -41,7 +41,7 @@ class DiagramWriter: def write(self, diadefs: Iterable[ClassDiagram | PackageDiagram]) -> None: """Write files for according to .""" for diagram in diadefs: - basename = diagram.title.strip().replace(" ", "_") + basename = diagram.title.strip().replace("/", "_").replace(" ", "_") file_name = f"{basename}.{self.config.output_format}" if os.path.exists(self.config.output_directory): file_name = os.path.join(self.config.output_directory, file_name) diff --git a/tests/pyreverse/test_writer.py b/tests/pyreverse/test_writer.py index 805f8fab5..0bf92d918 100644 --- a/tests/pyreverse/test_writer.py +++ b/tests/pyreverse/test_writer.py @@ -223,3 +223,20 @@ def test_color_for_stdlib_module(default_config: PyreverseConfig) -> None: obj.node = Mock() obj.node.qname.return_value = "collections" assert writer.get_shape_color(obj) == "grey" + + +def test_package_name_with_slash(default_config: PyreverseConfig) -> None: + """Test to check the names of the generated files are corrected + when using an incorrect character like "/" in the package name. + """ + writer = DiagramWriter(default_config) + obj = Mock() + + obj.objects = [] + obj.get_relationships.return_value = [] + obj.title = "test/package/name/with/slash/" + writer.write([obj]) + + assert os.path.exists("test_package_name_with_slash_.dot") + # remove the generated file + os.remove("test_package_name_with_slash_.dot") -- cgit v1.2.1 From 574edc3da35a750ef1ffe2bc4167acdb9e9bd357 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 3 Apr 2023 14:11:54 +0200 Subject: Upgrade astroid to 2.15.2 (#8530) (#8532) --- pyproject.toml | 4 ++-- requirements_test_min.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 333d2856e..559341011 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,8 +38,8 @@ dependencies = [ "platformdirs>=2.2.0", # Also upgrade requirements_test_min.txt. # Pinned to dev of second minor update to allow editable installs and fix primer issues, - # see https://github.com/PyCQA/astroid/issues/1341 - "astroid>=2.15.0,<=2.17.0-dev0", + # see https://github.com/pylint-dev/astroid/issues/1341 + "astroid>=2.15.2,<=2.17.0-dev0", "isort>=4.2.5,<6", "mccabe>=0.6,<0.8", "tomli>=1.1.0;python_version<'3.11'", diff --git a/requirements_test_min.txt b/requirements_test_min.txt index d3a76f096..08321b54f 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -1,6 +1,6 @@ -e .[testutils,spelling] # astroid dependency is also defined in pyproject.toml -astroid==2.15.0 # Pinned to a specific version for tests +astroid==2.15.2 # Pinned to a specific version for tests typing-extensions~=4.5 py~=1.11.0 pytest~=7.2 -- cgit v1.2.1 From 84c197d1674eb2aa1642e84a2580987190971ed1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 14:13:08 +0200 Subject: [Backport maintenance/2.17.x] Add regression test for #7506 (#8531) * Add regression test for #7506 (#8432) (cherry picked from commit 1fa16c2d8a7e97223541069731d28896f651b1ab) --------- Co-authored-by: Pierre Sassoulas Co-authored-by: Jacob Walls --- doc/whatsnew/fragments/7506.false_positive | 3 +++ requirements_test.txt | 1 + tests/functional/u/unused/unused_import.py | 7 +++++-- tests/functional/u/unused/unused_import.txt | 12 ++++++------ 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 doc/whatsnew/fragments/7506.false_positive diff --git a/doc/whatsnew/fragments/7506.false_positive b/doc/whatsnew/fragments/7506.false_positive new file mode 100644 index 000000000..c6424e1f2 --- /dev/null +++ b/doc/whatsnew/fragments/7506.false_positive @@ -0,0 +1,3 @@ +Fix ``unused-import`` false positive for usage of ``six.with_metaclass``. + +Closes #7506 diff --git a/requirements_test.txt b/requirements_test.txt index 3a9ad3f36..8a42362bf 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -6,6 +6,7 @@ contributors-txt>=1.0.0 pytest-cov~=4.0 pytest-profiling~=1.7 pytest-xdist~=3.2 +six # Type packages for mypy types-pkg_resources==0.1.3 tox>=3 diff --git a/tests/functional/u/unused/unused_import.py b/tests/functional/u/unused/unused_import.py index 3534cd0cf..0abc7bf4d 100644 --- a/tests/functional/u/unused/unused_import.py +++ b/tests/functional/u/unused/unused_import.py @@ -10,6 +10,7 @@ from sys import flags # [unused-import] # +1:[unused-import,unused-import] from collections import deque, OrderedDict, Counter import re, html.parser # [unused-import] +import six DATA = Counter() # pylint: disable=self-assigning-variable @@ -98,8 +99,10 @@ if TYPE_CHECKING: import zoneinfo -class WithMetaclass(metaclass=ABCMeta): - pass +class WithMetaclass(six.with_metaclass(ABCMeta)): + """Regression test for https://github.com/PyCQA/pylint/issues/7506. + + Requires six.""" # Regression test for https://github.com/PyCQA/pylint/issues/3765 diff --git a/tests/functional/u/unused/unused_import.txt b/tests/functional/u/unused/unused_import.txt index f242bcb23..f356843fa 100644 --- a/tests/functional/u/unused/unused_import.txt +++ b/tests/functional/u/unused/unused_import.txt @@ -6,9 +6,9 @@ unused-import:8:0:8:21::Unused flags imported from sys:UNDEFINED unused-import:11:0:11:51::Unused OrderedDict imported from collections:UNDEFINED unused-import:11:0:11:51::Unused deque imported from collections:UNDEFINED unused-import:12:0:12:22::Unused import re:UNDEFINED -unused-import:16:0:16:40::Unused SomeOtherName imported from fake:UNDEFINED -unused-import:53:0:53:9::Unused import os:UNDEFINED -unused-import:88:4:88:19::Unused import unittest:UNDEFINED -unused-import:90:4:90:15::Unused import uuid:UNDEFINED -unused-import:92:4:92:19::Unused import warnings:UNDEFINED -unused-import:94:4:94:21::Unused import compileall:UNDEFINED +unused-import:17:0:17:40::Unused SomeOtherName imported from fake:UNDEFINED +unused-import:54:0:54:9::Unused import os:UNDEFINED +unused-import:89:4:89:19::Unused import unittest:UNDEFINED +unused-import:91:4:91:15::Unused import uuid:UNDEFINED +unused-import:93:4:93:19::Unused import warnings:UNDEFINED +unused-import:95:4:95:21::Unused import compileall:UNDEFINED -- cgit v1.2.1 From de0147e92586be56cdee9711dd3d3a7a7e1c9ef2 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 3 Apr 2023 14:16:52 +0200 Subject: Bump pylint to 2.17.2, update changelog (#8533) --- doc/whatsnew/2/2.17/index.rst | 36 ++++++++++++++++++++++++++++++ doc/whatsnew/fragments/8485.false_positive | 5 ----- doc/whatsnew/fragments/8487.false_positive | 3 --- doc/whatsnew/fragments/8496.false_positive | 5 ----- doc/whatsnew/fragments/8504.bugfix | 3 --- pylint/__pkginfo__.py | 2 +- tbump.toml | 2 +- towncrier.toml | 2 +- 8 files changed, 39 insertions(+), 19 deletions(-) delete mode 100644 doc/whatsnew/fragments/8485.false_positive delete mode 100644 doc/whatsnew/fragments/8487.false_positive delete mode 100644 doc/whatsnew/fragments/8496.false_positive delete mode 100644 doc/whatsnew/fragments/8504.bugfix diff --git a/doc/whatsnew/2/2.17/index.rst b/doc/whatsnew/2/2.17/index.rst index b3f4b6175..cd06bbc2e 100644 --- a/doc/whatsnew/2/2.17/index.rst +++ b/doc/whatsnew/2/2.17/index.rst @@ -29,6 +29,42 @@ so we find problems before the actual release. .. towncrier release notes start +What's new in Pylint 2.17.2? +---------------------------- +Release date: 2023-04-03 + + +False Positives Fixed +--------------------- + +- ``invalid-name`` now allows for integers in ``typealias`` names: + - now valid: ``Good2Name``, ``GoodName2``. + - still invalid: ``_1BadName``. + + Closes #8485 (`#8485 `_) + +- No longer consider ``Union`` as type annotation as type alias for naming + checks. + + Closes #8487 (`#8487 `_) + +- ``unnecessary-lambda`` no longer warns on lambdas which use its parameters in + their body (other than the final arguments), e.g. + ``lambda foo: (bar if foo else baz)(foo)``. + + Closes #8496 (`#8496 `_) + + + +Other Bug Fixes +--------------- + +- Fix a crash in pyreverse when "/" characters are used in the output filename + e.g pyreverse -o png -p name/ path/to/project. + + Closes #8504 (`#8504 `_) + + What's new in Pylint 2.17.1? ---------------------------- Release date: 2023-03-22 diff --git a/doc/whatsnew/fragments/8485.false_positive b/doc/whatsnew/fragments/8485.false_positive deleted file mode 100644 index 8eac08b95..000000000 --- a/doc/whatsnew/fragments/8485.false_positive +++ /dev/null @@ -1,5 +0,0 @@ -``invalid-name`` now allows for integers in ``typealias`` names: -- now valid: ``Good2Name``, ``GoodName2``. -- still invalid: ``_1BadName``. - -Closes #8485 diff --git a/doc/whatsnew/fragments/8487.false_positive b/doc/whatsnew/fragments/8487.false_positive deleted file mode 100644 index 9ff5e3482..000000000 --- a/doc/whatsnew/fragments/8487.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -No longer consider ``Union`` as type annotation as type alias for naming checks. - -Closes #8487 diff --git a/doc/whatsnew/fragments/8496.false_positive b/doc/whatsnew/fragments/8496.false_positive deleted file mode 100644 index 3ea0fca6c..000000000 --- a/doc/whatsnew/fragments/8496.false_positive +++ /dev/null @@ -1,5 +0,0 @@ -``unnecessary-lambda`` no longer warns on lambdas which use its parameters in -their body (other than the final arguments), e.g. -``lambda foo: (bar if foo else baz)(foo)``. - -Closes #8496 diff --git a/doc/whatsnew/fragments/8504.bugfix b/doc/whatsnew/fragments/8504.bugfix deleted file mode 100644 index 2b54ac7b6..000000000 --- a/doc/whatsnew/fragments/8504.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Fix a crash in pyreverse when "/" characters are used in the output filename e.g pyreverse -o png -p name/ path/to/project. - -Closes #8504 diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index 897c373b9..beebd2492 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -9,7 +9,7 @@ It's updated via tbump, do not modify. from __future__ import annotations -__version__ = "2.17.1" +__version__ = "2.17.2" def get_numversion_from_version(v: str) -> tuple[int, int, int]: diff --git a/tbump.toml b/tbump.toml index 063a79c0e..1f6594b2e 100644 --- a/tbump.toml +++ b/tbump.toml @@ -1,7 +1,7 @@ github_url = "https://github.com/PyCQA/pylint" [version] -current = "2.17.1" +current = "2.17.2" regex = ''' ^(?P0|[1-9]\d*) \. diff --git a/towncrier.toml b/towncrier.toml index b8c00a8ff..35ce27243 100644 --- a/towncrier.toml +++ b/towncrier.toml @@ -1,5 +1,5 @@ [tool.towncrier] -version = "2.17.1" +version = "2.17.2" directory = "doc/whatsnew/fragments" filename = "doc/whatsnew/2/2.17/index.rst" template = "doc/whatsnew/fragments/_template.rst" -- cgit v1.2.1