Skip to content

Commit 0835dbf

Browse files
committed
clean up ruff errors (and ignore 1 print statement)
1 parent 1434cb7 commit 0835dbf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/update_s5cmdUrls.cmake.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!usr/bin/env python3
2+
from __future__ import annotations
23

34
import argparse
45
import re
@@ -40,8 +41,7 @@ def parse_args() -> argparse.Namespace:
4041
help="Path to the s5cmd file",
4142
default=Path(__file__).parents[1].joinpath("s5cmdUrls.cmake").as_posix(),
4243
)
43-
args = parser.parse_args()
44-
return args
44+
return parser.parse_args()
4545

4646

4747
def read_checksum_text(path: str) -> str:
@@ -51,12 +51,13 @@ def read_checksum_text(path: str) -> str:
5151

5252
_path = Path(path)
5353
if not _path.exists() or not _path.is_file():
54-
raise FileNotFoundError(f"Checksum file `{_path}` does not exist.")
54+
msg = f"Checksum file `{_path}` does not exist."
55+
raise FileNotFoundError(msg)
5556
return _path.read_text(encoding="utf-8")
5657

5758

5859
def generate_cmake_text(text: str) -> str:
59-
checksums = [l.split() for l in text.rstrip("\n").split("\n")]
60+
checksums = [line.split() for line in text.rstrip("\n").split("\n")]
6061

6162
version = re.search(VERSION_RE, checksums[0][1]).group(1)
6263
if version is None:
@@ -111,7 +112,7 @@ def overwrite_cmake_file(text: str, path: str) -> None:
111112
replaced_text = re.sub(TEXT_RE, text, cmake_text)
112113
_path.write_text(replaced_text, encoding="utf-8")
113114

114-
print(f"Updated `{_path}` with new checksums.")
115+
print(f"Checksum file `{_path}` updated.") # noqa: T201
115116

116117

117118
def main():

0 commit comments

Comments
 (0)