summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-02-23 22:05:19 +0000
committerGitHub <noreply@github.com>2023-02-23 22:05:19 +0000
commit27352c2bf9c1b3795e599ae63b1ead32a0522bc8 (patch)
tree3109efc3ba04dfb542328656c962f5e74e93416a
parent6f74553782e26c81d441ed1ccf4f31cf34997329 (diff)
downloadastroid-git-27352c2bf9c1b3795e599ae63b1ead32a0522bc8.tar.gz
Bump flake8-bugbear from 23.1.20 to 23.2.13 (#2034)
Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
-rw-r--r--.pre-commit-config.yaml2
-rw-r--r--astroid/decorators.py3
-rw-r--r--astroid/mixins.py1
-rw-r--r--astroid/node_classes.py1
-rw-r--r--astroid/nodes/node_classes.py2
-rw-r--r--astroid/nodes/node_ng.py2
-rw-r--r--astroid/nodes/scoped_nodes/scoped_nodes.py7
-rw-r--r--astroid/scoped_nodes.py1
-rw-r--r--requirements_test_pre_commit.txt2
9 files changed, 19 insertions, 2 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 631dc2e9..9b5cc55b 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -54,7 +54,7 @@ repos:
hooks:
- id: flake8
additional_dependencies:
- [flake8-bugbear==23.1.20, flake8-typing-imports==1.14.0]
+ [flake8-bugbear==23.2.13, flake8-typing-imports==1.14.0]
exclude: tests/testdata|doc/conf.py
- repo: local
hooks:
diff --git a/astroid/decorators.py b/astroid/decorators.py
index b99803a2..6bba37b6 100644
--- a/astroid/decorators.py
+++ b/astroid/decorators.py
@@ -67,6 +67,7 @@ class cachedproperty:
"cachedproperty has been deprecated and will be removed in astroid 3.0 for Python 3.8+. "
"Use functools.cached_property instead.",
DeprecationWarning,
+ stacklevel=2,
)
try:
wrapped.__name__
@@ -214,6 +215,7 @@ if util.check_warnings_filter(): # noqa: C901
f" in astroid {astroid_version} "
f"('{arg}' should be of type: '{type_annotation}')",
DeprecationWarning,
+ stacklevel=2,
)
return func(*args, **kwargs)
@@ -251,6 +253,7 @@ if util.check_warnings_filter(): # noqa: C901
f"'{args[0].__class__.__qualname__}.{func.__name__}' is deprecated "
f"and will be removed in astroid {astroid_version} ({note})",
DeprecationWarning,
+ stacklevel=2,
)
return func(*args, **kwargs)
diff --git a/astroid/mixins.py b/astroid/mixins.py
index d7fc1dee..942e824a 100644
--- a/astroid/mixins.py
+++ b/astroid/mixins.py
@@ -27,4 +27,5 @@ __all__ = (
warnings.warn(
"The 'astroid.mixins' module is deprecated and will become private in astroid 3.0.0",
DeprecationWarning,
+ stacklevel=2,
)
diff --git a/astroid/node_classes.py b/astroid/node_classes.py
index 59bb0109..9ea1e8d2 100644
--- a/astroid/node_classes.py
+++ b/astroid/node_classes.py
@@ -95,4 +95,5 @@ warnings.warn(
"The 'astroid.node_classes' module is deprecated and will be replaced by "
"'astroid.nodes' in astroid 3.0.0",
DeprecationWarning,
+ stacklevel=2,
)
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py
index 4611d86d..4a3cc7c3 100644
--- a/astroid/nodes/node_classes.py
+++ b/astroid/nodes/node_classes.py
@@ -3213,6 +3213,7 @@ class If(_base_nodes.MultiLineWithElseBlockNode, _base_nodes.Statement):
"It has been moved to pylint and can be imported from 'pylint.checkers.utils' "
"starting with pylint 2.12",
DeprecationWarning,
+ stacklevel=2,
)
if isinstance(self.test, Compare):
value = self.test.left
@@ -3240,6 +3241,7 @@ class If(_base_nodes.MultiLineWithElseBlockNode, _base_nodes.Statement):
"It has been moved to pylint and can be imported from 'pylint.checkers.utils' "
"starting with pylint 2.12",
DeprecationWarning,
+ stacklevel=2,
)
return isinstance(
self.test, (Name, Attribute)
diff --git a/astroid/nodes/node_ng.py b/astroid/nodes/node_ng.py
index 38172f5f..617f8ba4 100644
--- a/astroid/nodes/node_ng.py
+++ b/astroid/nodes/node_ng.py
@@ -321,6 +321,7 @@ class NodeNG:
"This behaviour can already be triggered "
"by passing 'future=True' to a statement() call.",
DeprecationWarning,
+ stacklevel=2,
)
raise AttributeError(f"{self} object has no attribute 'parent'")
return self.parent.statement(future=future)
@@ -344,6 +345,7 @@ class NodeNG:
"This behaviour can already be triggered "
"by passing 'future=True' to a frame() call.",
DeprecationWarning,
+ stacklevel=2,
)
raise AttributeError(f"{self} object has no attribute 'parent'")
diff --git a/astroid/nodes/scoped_nodes/scoped_nodes.py b/astroid/nodes/scoped_nodes/scoped_nodes.py
index 71e3975c..bec817d7 100644
--- a/astroid/nodes/scoped_nodes/scoped_nodes.py
+++ b/astroid/nodes/scoped_nodes/scoped_nodes.py
@@ -315,6 +315,7 @@ class Module(LocalsDictNodeNG):
"The 'Module.doc' attribute is deprecated, "
"use 'Module.doc_node' instead.",
DeprecationWarning,
+ stacklevel=2,
)
return self._doc
@@ -324,6 +325,7 @@ class Module(LocalsDictNodeNG):
"Setting the 'Module.doc' attribute is deprecated, "
"use 'Module.doc_node' instead.",
DeprecationWarning,
+ stacklevel=2,
)
self._doc = value
@@ -474,6 +476,7 @@ class Module(LocalsDictNodeNG):
"considered a statement. This behaviour can already be triggered "
"by passing 'future=True' to a statement() call.",
DeprecationWarning,
+ stacklevel=2,
)
return self
@@ -1403,6 +1406,7 @@ class FunctionDef(_base_nodes.MultiLineBlockNode, _base_nodes.Statement, Lambda)
"The 'FunctionDef.doc' attribute is deprecated, "
"use 'FunctionDef.doc_node' instead.",
DeprecationWarning,
+ stacklevel=2,
)
return self._doc
@@ -1412,6 +1416,7 @@ class FunctionDef(_base_nodes.MultiLineBlockNode, _base_nodes.Statement, Lambda)
"Setting the 'FunctionDef.doc' attribute is deprecated, "
"use 'FunctionDef.doc_node' instead.",
DeprecationWarning,
+ stacklevel=2,
)
self._doc = value
@@ -2038,6 +2043,7 @@ class ClassDef(
"The 'ClassDef.doc' attribute is deprecated, "
"use 'ClassDef.doc_node' instead.",
DeprecationWarning,
+ stacklevel=2,
)
return self._doc
@@ -2047,6 +2053,7 @@ class ClassDef(
"Setting the 'ClassDef.doc' attribute is deprecated, "
"use 'ClassDef.doc_node.value' instead.",
DeprecationWarning,
+ stacklevel=2,
)
self._doc = value
diff --git a/astroid/scoped_nodes.py b/astroid/scoped_nodes.py
index 1e3fbf31..0e5ef130 100644
--- a/astroid/scoped_nodes.py
+++ b/astroid/scoped_nodes.py
@@ -31,4 +31,5 @@ warnings.warn(
"The 'astroid.scoped_nodes' module is deprecated and will be replaced by "
"'astroid.nodes' in astroid 3.0.0",
DeprecationWarning,
+ stacklevel=2,
)
diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt
index 13bc3385..371936bd 100644
--- a/requirements_test_pre_commit.txt
+++ b/requirements_test_pre_commit.txt
@@ -4,6 +4,6 @@ pylint==2.16.2
isort==5.12.0;python_version>='3.8'
flake8==6.0.0;python_version>='3.8'
flake8-typing-imports==1.14.0;python_version>='3.8'
-flake8-bugbear==23.1.20;python_version>='3.8'
+flake8-bugbear==23.2.13;python_version>='3.8'
mypy==1.0.1
pre-commit~=2.21