From 6373e8d12fef4e235390f2014dca853d6bc6268c Mon Sep 17 00:00:00 2001 From: Christian Krinitsin Date: Sun, 25 May 2025 19:34:53 +0200 Subject: refactor gitlab script --- gitlab/output.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gitlab/output.py') diff --git a/gitlab/output.py b/gitlab/output.py index 745081aef..07293147b 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) -- cgit 1.4.1