Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit] Trying out black 23.1a1 #1909

Merged
merged 3 commits into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ repos:
- id: black-disable-checker
exclude: tests/unittest_nodes_lineno.py
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1a1
hooks:
- id: black
args: [--safe, --quiet]
Expand Down
1 change: 0 additions & 1 deletion astroid/brain/brain_namedtuple_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ def infer_named_tuple(
call_site = arguments.CallSite.from_call(node, context=context)
node = extract_node("import collections; collections.namedtuple")
try:

func = next(node.infer())
except StopIteration as e:
raise InferenceError(node=node) from e
Expand Down
2 changes: 1 addition & 1 deletion astroid/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def sort_locals(my_list: list[nodes.NodeNG]) -> None:
my_list.sort(key=_key_func)

assert node.parent # It should always default to the module
for (name, asname) in node.names:
for name, asname in node.names:
if name == "*":
try:
imported = node.do_import_module()
Expand Down
1 change: 0 additions & 1 deletion astroid/interpreter/objectmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,6 @@ def attr_keys(self):

@property
def attr_values(self):

values = [value for (_, value) in self._instance.items]
obj = node_classes.List(parent=self._instance)
obj.postinit(values)
Expand Down
1 change: 1 addition & 0 deletions astroid/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ def starred_assigned_stmts( # noqa: C901
A list of indices, where each index specifies what item to fetch from
the inference results.
"""

# pylint: disable=too-many-locals,too-many-statements
def _determine_starred_iteration_lookups(
starred: nodes.Starred, target: nodes.Tuple, lookups: list[tuple[int, int]]
Expand Down
2 changes: 1 addition & 1 deletion astroid/raw_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def object_build(
with warnings.catch_warnings():
warnings.simplefilter("ignore")
member = getattr(obj, name)
except (AttributeError):
except AttributeError:
# damned ExtensionClass.Base, I know you're there !
attach_dummy_node(node, name)
continue
Expand Down
2 changes: 1 addition & 1 deletion astroid/rebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ def visit_import(self, node: ast.Import, parent: NodeNG) -> nodes.Import:
parent=parent,
)
# save import names in parent's locals:
for (name, asname) in newnode.names:
for name, asname in newnode.names:
name = asname or name
parent.set_local(name.split(".")[0], newnode)
return newnode
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_pre_commit.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==22.12.0
black==23.1a1
pylint==2.15.9
isort==5.11.4
flake8==5.0.4
Expand Down
3 changes: 1 addition & 2 deletions tests/unittest_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def partialmethod(func, arg):


class InferenceTest(resources.SysPathSetup, unittest.TestCase):

# additional assertInfer* method for builtin types

def assertInferConst(self, node: nodes.Call, expected: str) -> None:
Expand Down Expand Up @@ -6498,7 +6497,7 @@ def __init__(self, *args, **kwargs):
assert inferred is util.Uninferable


def test_inferring_properties_multiple_time_does_not_mutate_locals_multiple_times() -> None:
def test_inferring_properties_multiple_time_does_not_mutate_locals() -> None:
code = """
class A:
@property
Expand Down