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

avoid commented-out code (ruff-ERA) #545

Merged
merged 6 commits into from
Jan 15, 2025
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: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ select = [
"I",
# flake8-comprehensions
"C4",
# eradicate
"ERA",
]
ignore = ["E501"] #ignore line-length violations

Expand Down
4 changes: 0 additions & 4 deletions tests/unit/nodes/test_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ class AComposite(Composite):
def __init__(self, label):
super().__init__(label=label)

def _get_linking_channel(self, child_reference_channel, composite_io_key):
pass # Shouldn't even be abstract honestly
# return child_reference_channel # IO by reference

@property
def inputs(self) -> Inputs:
# Dynamic IO reflecting current children
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/nodes/test_for_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def FiveApart(
d=[9, 10, 11],
e="e",
output_column_map={
# "a": "out_a",
# Note the absence of the "a" conflicting entry
"b": "out_b",
"c": "out_c",
"d": "out_d",
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/nodes/test_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def test_label_choices(self):
self.subTest("Fail on multiple return values"),
self.assertRaises(ValueError),
):
# Can't automatically parse output labels from a function with multiple
# return expressions
# Can't automatically parse output labels from a function with
# multiple return expressions
function_node(multiple_branches)

with self.subTest("Override output label scraping"):
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/nodes/test_macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ def test_with_executor(self):
returned_nodes.one,
msg="Executing in a parallel process should be returning new instances",
)
# self.assertIs(
# returned_nodes.one,
# macro.nodes.one,
# msg="Returned nodes should be taken as children"
# ) # You can't do this, result.result() is returning new instances each call
self.assertIs(
returned_nodes.one,
macro.one,
msg="Returned nodes should be taken as children",
)
self.assertIs(
macro,
macro.one.parent,
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/test_type_hinting.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ def __call__(self):
(typing.Literal[1, 2], 1, "baz"),
(Foo, Foo(), Foo),
(type[Bar], Bar, Bar()),
# (callable, Bar(), Foo()), # Misses the bad!
# Can't hint args and returns without typing.Callable anyhow, so that's
# what people should be using regardless
(typing.Callable, Bar(), Foo()),
(tuple[int, float], (1, 1.1), ("fo", 0)),
(dict[str, int], {"a": 1}, {"a": "b"}),
Expand Down
Loading