diff options
author | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-09-09 23:05:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 23:05:00 +0200 |
commit | 0cc82c4c0de8771c1323cc2e183497d722ea5bfe (patch) | |
tree | 85ff551d96291e647a1b865ce13df9808ad3d4c5 /pylint/checkers/refactoring/refactoring_checker.py | |
parent | ddde4fc074d0b4ae678f5111aafd0f54f3ddf409 (diff) | |
download | pylint-git-0cc82c4c0de8771c1323cc2e183497d722ea5bfe.tar.gz |
Turn on ``mypy`` strict mode 🎉 (#7448)
* Ignore subclasses of Any
* Add ignores for imported code and remove casts
* Add disables for uninferable return values
* Turn on ``mypy`` strict mode
Diffstat (limited to 'pylint/checkers/refactoring/refactoring_checker.py')
-rw-r--r-- | pylint/checkers/refactoring/refactoring_checker.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pylint/checkers/refactoring/refactoring_checker.py b/pylint/checkers/refactoring/refactoring_checker.py index 32bee4711..ed1b7a938 100644 --- a/pylint/checkers/refactoring/refactoring_checker.py +++ b/pylint/checkers/refactoring/refactoring_checker.py @@ -147,7 +147,7 @@ def _is_part_of_with_items(node: nodes.Call) -> bool: if isinstance(current, nodes.With): items_start = current.items[0][0].lineno items_end = current.items[-1][0].tolineno - return items_start <= node.lineno <= items_end + return items_start <= node.lineno <= items_end # type: ignore[no-any-return] current = current.parent return False @@ -181,7 +181,7 @@ def _is_part_of_assignment_target(node: nodes.NodeNG) -> bool: return node in node.parent.targets if isinstance(node.parent, nodes.AugAssign): - return node == node.parent.target + return node == node.parent.target # type: ignore[no-any-return] if isinstance(node.parent, (nodes.Tuple, nodes.List)): return _is_part_of_assignment_target(node.parent) @@ -523,7 +523,7 @@ class RefactoringChecker(checkers.BaseTokenChecker): @cached_property def _dummy_rgx(self) -> Pattern[str]: - return self.linter.config.dummy_variables_rgx + return self.linter.config.dummy_variables_rgx # type: ignore[no-any-return] @staticmethod def _is_bool_const(node: nodes.Return | nodes.Assign) -> bool: @@ -748,13 +748,13 @@ class RefactoringChecker(checkers.BaseTokenChecker): @staticmethod def _type_and_name_are_equal(node_a: Any, node_b: Any) -> bool: if isinstance(node_a, nodes.Name) and isinstance(node_b, nodes.Name): - return node_a.name == node_b.name + return node_a.name == node_b.name # type: ignore[no-any-return] if isinstance(node_a, nodes.AssignName) and isinstance( node_b, nodes.AssignName ): - return node_a.name == node_b.name + return node_a.name == node_b.name # type: ignore[no-any-return] if isinstance(node_a, nodes.Const) and isinstance(node_b, nodes.Const): - return node_a.value == node_b.value + return node_a.value == node_b.value # type: ignore[no-any-return] return False def _is_dict_get_block(self, node: nodes.If) -> bool: |