Skip to content

Commit

Permalink
Bump flake8-bugbear from 23.1.20 to 23.2.13 (#2034)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and DanielNoord committed Feb 23, 2023
1 parent 6f74553 commit 27352c2
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions astroid/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __init__(self, wrapped):
"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__
Expand Down Expand Up @@ -214,6 +215,7 @@ def wrapper(*args: _P.args, **kwargs: _P.kwargs) -> _R:
f" in astroid {astroid_version} "
f"('{arg}' should be of type: '{type_annotation}')",
DeprecationWarning,
stacklevel=2,
)
return func(*args, **kwargs)

Expand Down Expand Up @@ -251,6 +253,7 @@ def wrapper(*args: _P.args, **kwargs: _P.kwargs) -> _R:
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)

Expand Down
1 change: 1 addition & 0 deletions astroid/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
warnings.warn(
"The 'astroid.mixins' module is deprecated and will become private in astroid 3.0.0",
DeprecationWarning,
stacklevel=2,
)
1 change: 1 addition & 0 deletions astroid/node_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,5 @@
"The 'astroid.node_classes' module is deprecated and will be replaced by "
"'astroid.nodes' in astroid 3.0.0",
DeprecationWarning,
stacklevel=2,
)
2 changes: 2 additions & 0 deletions astroid/nodes/node_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3213,6 +3213,7 @@ def is_sys_guard(self) -> bool:
"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
Expand Down Expand Up @@ -3240,6 +3241,7 @@ def is_typing_guard(self) -> bool:
"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)
Expand Down
2 changes: 2 additions & 0 deletions astroid/nodes/node_ng.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ def statement(
"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)
Expand All @@ -344,6 +345,7 @@ def frame(
"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'")

Expand Down
7 changes: 7 additions & 0 deletions astroid/nodes/scoped_nodes/scoped_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def doc(self) -> str | None:
"The 'Module.doc' attribute is deprecated, "
"use 'Module.doc_node' instead.",
DeprecationWarning,
stacklevel=2,
)
return self._doc

Expand All @@ -324,6 +325,7 @@ def doc(self, value: str | None) -> None:
"Setting the 'Module.doc' attribute is deprecated, "
"use 'Module.doc_node' instead.",
DeprecationWarning,
stacklevel=2,
)
self._doc = value

Expand Down Expand Up @@ -474,6 +476,7 @@ def statement(self, *, future: Literal[None, True] = None) -> Module | NoReturn:
"considered a statement. This behaviour can already be triggered "
"by passing 'future=True' to a statement() call.",
DeprecationWarning,
stacklevel=2,
)
return self

Expand Down Expand Up @@ -1403,6 +1406,7 @@ def doc(self) -> str | None:
"The 'FunctionDef.doc' attribute is deprecated, "
"use 'FunctionDef.doc_node' instead.",
DeprecationWarning,
stacklevel=2,
)
return self._doc

Expand All @@ -1412,6 +1416,7 @@ def doc(self, value: str | None) -> None:
"Setting the 'FunctionDef.doc' attribute is deprecated, "
"use 'FunctionDef.doc_node' instead.",
DeprecationWarning,
stacklevel=2,
)
self._doc = value

Expand Down Expand Up @@ -2038,6 +2043,7 @@ def doc(self) -> str | None:
"The 'ClassDef.doc' attribute is deprecated, "
"use 'ClassDef.doc_node' instead.",
DeprecationWarning,
stacklevel=2,
)
return self._doc

Expand All @@ -2047,6 +2053,7 @@ def doc(self, value: str | None) -> None:
"Setting the 'ClassDef.doc' attribute is deprecated, "
"use 'ClassDef.doc_node.value' instead.",
DeprecationWarning,
stacklevel=2,
)
self._doc = value

Expand Down
1 change: 1 addition & 0 deletions astroid/scoped_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
"The 'astroid.scoped_nodes' module is deprecated and will be replaced by "
"'astroid.nodes' in astroid 3.0.0",
DeprecationWarning,
stacklevel=2,
)
2 changes: 1 addition & 1 deletion requirements_test_pre_commit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 27352c2

Please sign in to comment.