Skip to content

Commit 56fafdf

Browse files
authored
Merge pull request #267 from SciCatProject/update-pre-commit
Update pre-commit hooks
2 parents 7e83108 + 449eaa4 commit 56fafdf

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
args: ["--drop-empty-cells",
2222
"--extra-keys 'metadata.language_info.version cell.metadata.jp-MarkdownHeadingCollapsed cell.metadata.pycharm'"]
2323
- repo: https://github.com/astral-sh/ruff-pre-commit
24-
rev: v0.8.3
24+
rev: v0.9.1
2525
hooks:
2626
- id: ruff-format
2727
types_or: [ python, pyi ]
@@ -43,6 +43,6 @@ repos:
4343
- id: rst-inline-touching-normal
4444
- id: text-unicode-replacement-char
4545
- repo: https://github.com/rhysd/actionlint
46-
rev: v1.7.4
46+
rev: v1.7.6
4747
hooks:
4848
- id: actionlint

src/scitacean/_html_repr/_dataset_html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def _human_readable_size(size_in_bytes: int) -> str:
202202
for power, prefix in ((4, "T"), (3, "G"), (2, "M"), (1, "k")):
203203
n = 1024**power
204204
if size_in_bytes >= n:
205-
return f"{size_in_bytes/n:.2f} {prefix}iB"
205+
return f"{size_in_bytes / n:.2f} {prefix}iB"
206206
return f"{size_in_bytes} B"
207207

208208

src/scitacean/_internal/file_counter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def decrement(self) -> Generator[int, None, None]:
5252
count = self._read() - 1
5353
if count < 0:
5454
raise RuntimeError(
55-
f"Broken file counter, got a file with a count of {count-1}."
55+
f"Broken file counter, got a file with a count of {count - 1}."
5656
)
5757
if count == 0:
5858
self._path.unlink()

src/scitacean/filesystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self, *path_segments: str | RemotePath) -> None:
4646
)
4747
if not isinstance(segment, (str, RemotePath)):
4848
raise TypeError(
49-
"Expected str or RemotePath, " f"got {type(segment).__name__}"
49+
f"Expected str or RemotePath, got {type(segment).__name__}"
5050
)
5151
self._path = "/".join(s for segment in path_segments if (s := _posix(segment)))
5252

src/scitacean/testing/sftp/_sftp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def configure(target_dir: Path | str) -> Path:
8989
target_dir.joinpath("Dockerfile-sftp-server").write_text(_docker_file())
9090

9191
target_dir.joinpath(".env").write_text(
92-
f"""DATA_DIR={target_dir / 'data'}
92+
f"""DATA_DIR={target_dir / "data"}
9393
SEED_DIR={target_seed_dir}"""
9494
)
9595

src/scitacean/transfer/sftp.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ def upload_files(self, *files: File) -> list[File]:
9090
def _upload_file(self, file: File) -> File:
9191
if file.local_path is None:
9292
raise ValueError(
93-
f"Cannot upload file to {file.remote_path}, "
94-
"the file has no local path"
93+
f"Cannot upload file to {file.remote_path}, the file has no local path"
9594
)
9695
remote_path = self.remote_path(file.remote_path)
9796
get_logger().info(

tests/client/datablock_client_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ def test_create_first_orig_datablock(
7979
assert downloaded.dataFileList is not None
8080
for i in range(len(orig_datablock.dataFileList)):
8181
for key, expected in orig_datablock.dataFileList[i]:
82-
assert (
83-
dict(downloaded.dataFileList[i])[key] == expected
84-
), f"i = {i}, key = {key}"
82+
assert dict(downloaded.dataFileList[i])[key] == expected, (
83+
f"i = {i}, key = {key}"
84+
)

0 commit comments

Comments
 (0)