From 95337f33d61c0e30c9a1f64d96c219b85192082c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 10:34:59 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/whatsnew/fragments/8893.false_negative | 2 +- pylint/checkers/variables.py | 2 +- tests/functional/u/used/used_before_assignment_scoping.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/whatsnew/fragments/8893.false_negative b/doc/whatsnew/fragments/8893.false_negative index c7088424b7..5760b384f1 100644 --- a/doc/whatsnew/fragments/8893.false_negative +++ b/doc/whatsnew/fragments/8893.false_negative @@ -1,3 +1,3 @@ Fix false negative for `used-before-assignment` when a `TYPE_CHECKING` import is used as a type annotation prior to erroneous usage. -Refs #8893 \ No newline at end of file +Refs #8893 diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index 33d1320491..e7740fb1ec 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1985,7 +1985,7 @@ def _filter_type_checking_import_from_consumption( self, node: nodes.NodeNG, nodes_to_consume: list[nodes.NodeNG], - is_reported: bool + is_reported: bool, ) -> list[nodes.NodeNG]: """Do not consume type-checking import node as used-before-assignment may invoke in different scopes. diff --git a/tests/functional/u/used/used_before_assignment_scoping.py b/tests/functional/u/used/used_before_assignment_scoping.py index dd26dc6d81..0d88210bdd 100644 --- a/tests/functional/u/used/used_before_assignment_scoping.py +++ b/tests/functional/u/used/used_before_assignment_scoping.py @@ -15,4 +15,4 @@ def func(): first: datetime first = datetime.now() # [used-before-assignment] second = datetime.now() - return first, second \ No newline at end of file + return first, second