From 9db6140a20d46eff934ef31ae63674579f2b7540 Mon Sep 17 00:00:00 2001 From: Carly Gundy <47304080+cgundy@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:12:38 +0100 Subject: [PATCH] chore(IDX): exclude blank lines (#94) --- .../repo_policies/bot_checks/check_bot_approved_files.py | 2 +- reusable_workflows/tests/test_data/BOT_APPROVED_FILES | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/reusable_workflows/repo_policies/bot_checks/check_bot_approved_files.py b/reusable_workflows/repo_policies/bot_checks/check_bot_approved_files.py index 901b856..9e158cc 100644 --- a/reusable_workflows/repo_policies/bot_checks/check_bot_approved_files.py +++ b/reusable_workflows/repo_policies/bot_checks/check_bot_approved_files.py @@ -57,7 +57,7 @@ def get_approved_files(config_file: str) -> list[str]: Extracts the list of approved files from the config file. """ approved_files = [ - line for line in config_file.splitlines() if not line.strip().startswith("#") + line for line in config_file.splitlines() if line.strip() and not line.strip().startswith("#") ] return approved_files diff --git a/reusable_workflows/tests/test_data/BOT_APPROVED_FILES b/reusable_workflows/tests/test_data/BOT_APPROVED_FILES index 702da11..bb1f594 100644 --- a/reusable_workflows/tests/test_data/BOT_APPROVED_FILES +++ b/reusable_workflows/tests/test_data/BOT_APPROVED_FILES @@ -1,3 +1,4 @@ # Comment + file1 file2