Skip to content

Commit fad6fb2

Browse files
committed
Fix: Correct exemption_filenames type in load_archive_rules function
- Previously, the function returned a single string for exemption_filename, but it should return a list of strings. - This change ensures that the function correctly handles multiple exemption filenames as intended. - Also updated the type hints and docstring accordingly.
1 parent 3644ae7 commit fad6fb2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,22 +328,22 @@ def get_repositories(
328328
return repositories, number_of_pages
329329

330330

331-
def load_archive_rules(archive_rules: dict) -> Tuple[int, int, str, str, int]:
331+
def load_archive_rules(archive_rules: dict) -> Tuple[int, int, str, list[str], int]:
332332
"""Loads the archive rules from the configuration file.
333333
334334
Args:
335335
archive_rules (dict): The archive rules from the configuration file.
336336
337337
Returns:
338-
Tuple[int, int, str, str, int]: The archive threshold, the notification period, the notification issue tag, the exemption filename, and the maximum number of notifications.
338+
Tuple[int, int, str, list[str], int]: The archive threshold, the notification period, the notification issue tag, a list of exemption filenames, and the maximum number of notifications.
339339
"""
340340
archive_threshold = int(get_dict_value(archive_rules, "archive_threshold"))
341341
notification_period = int(get_dict_value(archive_rules, "notification_period"))
342342
notification_issue_tag = str(get_dict_value(archive_rules, "notification_issue_tag"))
343-
exemption_filename = str(get_dict_value(archive_rules, "exemption_filename"))
343+
exemption_filenames = list(get_dict_value(archive_rules, "exemption_filename"))
344344
maximum_notifications = int(get_dict_value(archive_rules, "maximum_notifications"))
345345

346-
return archive_threshold, notification_period, notification_issue_tag, exemption_filename, maximum_notifications
346+
return archive_threshold, notification_period, notification_issue_tag, exemption_filenames, maximum_notifications
347347

348348

349349
def handle_response(logger: wrapped_logging, response: Any, message: str) -> bool:

0 commit comments

Comments
 (0)