Skip to content

Commit 7b604b8

Browse files
Enforce Perflint rule PERF401 (#1608)
1 parent c8112a2 commit 7b604b8

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: check-yaml
1515
- repo: https://github.com/astral-sh/ruff-pre-commit
1616
# Ruff version.
17-
rev: v0.3.4
17+
rev: v0.4.4
1818
hooks:
1919
# Run the linter.
2020
- id: ruff

fsspec/implementations/tests/test_dirfs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,7 @@ async def _walk(path, *args, **kwargs):
353353
adirfs.fs._walk = mocker.MagicMock()
354354
adirfs.fs._walk.side_effect = _walk
355355

356-
actual = []
357-
async for entry in adirfs._walk("root", *ARGS, **KWARGS):
358-
actual.append(entry) # noqa: PERF402
356+
actual = [entry async for entry in adirfs._walk("root", *ARGS, **KWARGS)]
359357
assert actual == [("root", ["foo", "bar"], ["baz", "qux"])]
360358
adirfs.fs._walk.assert_called_once_with(f"{PATH}/root", *ARGS, **KWARGS)
361359

fsspec/implementations/tests/test_http.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,7 @@ async def test_async_walk(server):
564564
fs = fsspec.filesystem("http", asynchronous=True, skip_instance_cache=True)
565565

566566
# No maxdepth
567-
res = []
568-
async for a in fs._walk(server + "/index"):
569-
res.append(a) # noqa: PERF402
567+
res = [a async for a in fs._walk(server + "/index")]
570568
assert res == [(server + "/index", [], ["realfile"])]
571569

572570
# maxdepth=0

0 commit comments

Comments
 (0)