Skip to content

Commit

Permalink
Added blacklist to check_copyright_header.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mreso committed Feb 15, 2024
1 parent 008a90d commit ce3c2ec
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/check_copyright_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@
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
BLACKLIST = ["eval/open_llm_leaderboard/hellaswag_utils.py"]

if __name__ == "__main__":
for ext in ["*.py", "*.sh"]:
for file in WORK_DIR.rglob(ext):
normalized = file.relative_to(WORK_DIR)
if normalized.as_posix() in BLACKLIST:
continue

text = file.read_text()
if not re.search(PATTERN, text):
text = HEADER + text
Expand Down

0 comments on commit ce3c2ec

Please sign in to comment.