Skip to content

Commit

Permalink
[pre-commit] Trying out black 23.1a1
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Dec 21, 2022
1 parent 39d9caf commit 3a9eb05
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
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.8
isort==5.10.1
flake8==5.0.4
Expand Down
5 changes: 3 additions & 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,9 @@ 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_multiple_times() -> (
None
):
code = """
class A:
@property
Expand Down

0 comments on commit 3a9eb05

Please sign in to comment.