Skip to content

Commit 2eec0cd

Browse files
DimitriPapadopoulosd-v-b
authored andcommitted
Enforce ruff/flynt rules (FLY) (zarr-developers#2240)
* Apply ruff/flynt rule FLY002 FLY002 Consider f-string instead of string join * Enforce ruff/flynt rules (FLY)
1 parent 3ee37f1 commit 2eec0cd

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ extend-exclude = [
208208
[tool.ruff.lint]
209209
extend-select = [
210210
"B", # flake8-bugbear
211+
"FLY", # flynt
211212
"I", # isort
212213
"ISC", # flake8-implicit-str-concat
213214
"PGH", # pygrep-hooks

src/zarr/core/group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ async def _members(
676676
async for child_key, val in obj._members(
677677
max_depth=max_depth, current_depth=current_depth + 1
678678
):
679-
yield "/".join([key, child_key]), val
679+
yield f"{key}/{child_key}", val
680680
except KeyError:
681681
# keyerror is raised when `key` names an object (in the object storage sense),
682682
# as opposed to a prefix, in the store under the prefix associated with this group

src/zarr/store/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,6 @@ async def list_prefix(self, prefix: str) -> AsyncGenerator[str, None]:
243243
AsyncGenerator[str, None]
244244
"""
245245

246-
find_str = "/".join([self.path, prefix])
246+
find_str = f"{self.path}/{prefix}"
247247
for onefile in await self.fs._find(find_str, detail=False, maxdepth=None, withdirs=False):
248248
yield onefile.removeprefix(find_str)

0 commit comments

Comments
 (0)