Skip to content

Commit 10bb5c5

Browse files
XzzXliamhuber
andauthored
avoid commented-out code (ruff-ERA) (#545)
* avoid commented-out code (ERA) * Remove unused test class method Signed-off-by: liamhuber <[email protected]> * Replace code comment with english comment Signed-off-by: liamhuber <[email protected]> * Uncomment test And remove outdated comment. Signed-off-by: liamhuber <[email protected]> * Removed commented test portion Signed-off-by: liamhuber <[email protected]> * Black Signed-off-by: liamhuber <[email protected]> --------- Signed-off-by: liamhuber <[email protected]> Co-authored-by: liamhuber <[email protected]>
1 parent 53a5c14 commit 10bb5c5

File tree

6 files changed

+10
-15
lines changed

6 files changed

+10
-15
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ select = [
8484
"I",
8585
# flake8-comprehensions
8686
"C4",
87+
# eradicate
88+
"ERA",
8789
]
8890
ignore = ["E501"] #ignore line-length violations
8991

tests/unit/nodes/test_composite.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ class AComposite(Composite):
2222
def __init__(self, label):
2323
super().__init__(label=label)
2424

25-
def _get_linking_channel(self, child_reference_channel, composite_io_key):
26-
pass # Shouldn't even be abstract honestly
27-
# return child_reference_channel # IO by reference
28-
2925
@property
3026
def inputs(self) -> Inputs:
3127
# Dynamic IO reflecting current children

tests/unit/nodes/test_for_loop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def FiveApart(
354354
d=[9, 10, 11],
355355
e="e",
356356
output_column_map={
357-
# "a": "out_a",
357+
# Note the absence of the "a" conflicting entry
358358
"b": "out_b",
359359
"c": "out_c",
360360
"d": "out_d",

tests/unit/nodes/test_function.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ def test_label_choices(self):
136136
self.subTest("Fail on multiple return values"),
137137
self.assertRaises(ValueError),
138138
):
139-
# Can't automatically parse output labels from a function with multiple
140-
# return expressions
139+
# Can't automatically parse output labels from a function with
140+
# multiple return expressions
141141
function_node(multiple_branches)
142142

143143
with self.subTest("Override output label scraping"):

tests/unit/nodes/test_macro.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,11 @@ def test_with_executor(self):
245245
returned_nodes.one,
246246
msg="Executing in a parallel process should be returning new instances",
247247
)
248-
# self.assertIs(
249-
# returned_nodes.one,
250-
# macro.nodes.one,
251-
# msg="Returned nodes should be taken as children"
252-
# ) # You can't do this, result.result() is returning new instances each call
248+
self.assertIs(
249+
returned_nodes.one,
250+
macro.one,
251+
msg="Returned nodes should be taken as children",
252+
)
253253
self.assertIs(
254254
macro,
255255
macro.one.parent,

tests/unit/test_type_hinting.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ def __call__(self):
2727
(typing.Literal[1, 2], 1, "baz"),
2828
(Foo, Foo(), Foo),
2929
(type[Bar], Bar, Bar()),
30-
# (callable, Bar(), Foo()), # Misses the bad!
31-
# Can't hint args and returns without typing.Callable anyhow, so that's
32-
# what people should be using regardless
3330
(typing.Callable, Bar(), Foo()),
3431
(tuple[int, float], (1, 1.1), ("fo", 0)),
3532
(dict[str, int], {"a": 1}, {"a": "b"}),

0 commit comments

Comments
 (0)