From 5f3d6b2970e3848eb432c33cc1e016e0fbdac381 Mon Sep 17 00:00:00 2001 From: Mandlin Sarah Date: Tue, 3 Sep 2024 01:19:58 -0700 Subject: [PATCH] Enhance script by adding handling for all text file extensions --- .github/scripts/check_copyright_header.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/check_copyright_header.py b/.github/scripts/check_copyright_header.py index 6d5f2eaef..173d66b1d 100644 --- a/.github/scripts/check_copyright_header.py +++ b/.github/scripts/check_copyright_header.py @@ -10,11 +10,11 @@ HEADER = """# Copyright (c) Meta Platforms, Inc. and affiliates. # This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.\n\n""" -#Files in black list must be relative to main repo folder +# Files in black list must be relative to main repo folder BLACKLIST = ["tools/benchmarks/llm_eval_harness/open_llm_leaderboard/hellaswag_utils.py"] if __name__ == "__main__": - for ext in ["*.py", "*.sh"]: + for ext in ["*.py", "*.sh", "*.txt", "*.md", "*.yaml", "*.yml"]: for file in WORK_DIR.rglob(ext): normalized = file.relative_to(WORK_DIR) if normalized.as_posix() in BLACKLIST: @@ -24,4 +24,4 @@ if not re.search(PATTERN, text): text = HEADER + text file.write_text(text) - \ No newline at end of file +