Skip to content

Commit a5c0a67

Browse files
committed
Active linter for style around comprehensions
1 parent 5022342 commit a5c0a67

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

btest

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ class TestManager(mp_managers.SyncManager):
478478
f"PortRange {port_range} cannot satisfy requirement of {max_test_ports} ports in test {test_with_most_ports.name}"
479479
)
480480

481-
self._ports = self.list([p for p in range(port_range_lo, port_range_hi + 1)])
481+
self._ports = self.list(list(range(port_range_lo, port_range_hi + 1)))
482482

483483
threads = []
484484

@@ -1378,7 +1378,7 @@ class Test:
13781378

13791379
def finish(self):
13801380
if self.bound_ports:
1381-
self.mgr.returnPorts([p for p in self.bound_ports])
1381+
self.mgr.returnPorts(list(self.bound_ports))
13821382

13831383
self.bound_ports = []
13841384

@@ -2543,7 +2543,7 @@ def mergeTestParts(tests):
25432543
except KeyError:
25442544
out[t.name] = t
25452545

2546-
return sorted([t for t in out.values()], key=key)
2546+
return sorted(out.values(), key=key)
25472547

25482548

25492549
# Read the given test file and instantiate one or more tests from it.
@@ -2576,7 +2576,7 @@ def readTestFile(filename):
25762576
state = "test"
25772577

25782578
try:
2579-
lines = [line for line in input]
2579+
lines = list(input)
25802580
except UnicodeDecodeError as e:
25812581
# This error is caused by either a test file with an invalid UTF-8 byte
25822582
# sequence, or if python makes the wrong assumption about the encoding

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ per-file-ignores = """
7373
"""
7474

7575
[tool.ruff.lint]
76-
select = ["UP"]
76+
select = ["C4", "UP"]

0 commit comments

Comments
 (0)