Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance script to handle all text file extensions #660

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/scripts/check_copyright_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -24,4 +24,4 @@
if not re.search(PATTERN, text):
text = HEADER + text
file.write_text(text)