Skip to content

Commit 9de98b5

Browse files
committed
CI: Fix Python linting
1 parent 425e647 commit 9de98b5

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- uses: psf/black@stable
2020
with:
21-
options: --check --diff --experimental-string-processing
21+
options: --check --diff --preview
2222
src: scripts
2323

2424
- uses: isort/isort-action@master

scripts/mt32pi_updater.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,18 @@ def print_retry(attempt):
204204

205205
def print_socket_connection_failed():
206206
print(
207-
"Couldn't connect to your mt32-pi - you did enable networking and the FTP"
208-
f" server in {COLOR_PURPLE}mt32-pi.cfg{COLOR_RESET}, right?",
207+
(
208+
"Couldn't connect to your mt32-pi - you did enable networking and the FTP"
209+
f" server in {COLOR_PURPLE}mt32-pi.cfg{COLOR_RESET}, right?"
210+
),
209211
file=sys.stderr,
210212
)
211213
print(
212-
"This script requires that you are running mt32-pi"
213-
f" {COLOR_PURPLE}v0.11.0{COLOR_RESET} or above. Previous versions do not"
214-
" feature the FTP server.",
214+
(
215+
"This script requires that you are running mt32-pi"
216+
f" {COLOR_PURPLE}v0.11.0{COLOR_RESET} or above. Previous versions do not"
217+
" feature the FTP server."
218+
),
215219
file=sys.stderr,
216220
)
217221

@@ -335,8 +339,10 @@ def self_update():
335339

336340
print_result("WARNING!", COLOR_YELLOW)
337341
print(
338-
"Unable to find version information in latest script from GitHub;"
339-
" continuing anyway...",
342+
(
343+
"Unable to find version information in latest script from GitHub;"
344+
" continuing anyway..."
345+
),
340346
file=sys.stderr,
341347
)
342348

@@ -349,8 +355,10 @@ def get_current_version(ftp):
349355
result = re.search(r"mt32-pi (v[0-9]+.[0-9]+.[0-9]+)", ftp.getwelcome())
350356
if not result:
351357
print(
352-
"Failed to extract version number from FTP welcome message; continuing"
353-
" anyway",
358+
(
359+
"Failed to extract version number from FTP welcome message; continuing"
360+
" anyway"
361+
),
354362
file=sys.stderr,
355363
)
356364
return "<unknown>"
@@ -587,7 +595,7 @@ def install(ftp, source_path, config):
587595
filter_dirs = [Path(path[:-1]) for path in ignore_list if path.endswith("/")]
588596
filter_files = [Path(path) for path in ignore_list if not path.endswith("/")]
589597

590-
for (dir_path, dir_names, filenames) in os.walk(source_path):
598+
for dir_path, dir_names, filenames in os.walk(source_path):
591599
remote_dir = Path(dir_path.replace(str(source_path), "").lstrip(os.sep))
592600

593601
for file_name in filenames:

0 commit comments

Comments
 (0)