diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-05-25 19:34:53 +0200 |
|---|---|---|
| committer | Christian Krinitsin <mail@krinitsin.com> | 2025-05-25 19:34:53 +0200 |
| commit | 6373e8d12fef4e235390f2014dca853d6bc6268c (patch) | |
| tree | c47a7ec807ea074558c97ba648c8bf23b24abe99 /gitlab/output.py | |
| parent | cc84a7857c120d4c1c1b150e7fb8676d30fb5957 (diff) | |
| download | emulator-bug-study-6373e8d12fef4e235390f2014dca853d6bc6268c.tar.gz emulator-bug-study-6373e8d12fef4e235390f2014dca853d6bc6268c.zip | |
refactor gitlab script
Diffstat (limited to '')
| -rwxr-xr-x | gitlab/output.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gitlab/output.py b/gitlab/output.py index 745081ae..07293147 100755 --- a/gitlab/output.py +++ b/gitlab/output.py @@ -1,18 +1,18 @@ from tomlkit import dumps from os import path, makedirs -def find_label(labels, keyword): +def find_label(labels : list, keyword : str) -> str: match = next((s for s in labels if f"{keyword}:" in s), None) if not match: return f"{keyword}_missing" return match.replace(": ", "_") -def write_file(file_path, string): - makedirs(path.dirname(file_path), exist_ok=True) +def write_file(file_path : str, string : str) -> None: + makedirs(path.dirname(file_path), exist_ok = True) with open(file_path, "w") as file: file.write(string) -def output_issue(issue): +def output_issue(issue : dict) -> None: labels = issue['labels'] issue_id = issue['id'] toml_string = dumps(issue) |