Skip to content

Commit

Permalink
change script
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Sep 18, 2024
1 parent 568b8c2 commit 7b1d375
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/license_checker_and_adder.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def is_license_file(filename: str) -> bool:

def check_file(file_path: Path, action: str, license_as_list: List[str], license_to_save: List[str]) -> bool:
file_content = file_path.read_text().splitlines()
if len(file_content) >= 11 and file_content[:11] == license_as_list:
n = len(license_as_list)
if len(file_content) >= n and file_content[:n] == license_as_list:
return True
click.echo(f"{file_path} has no valid header.")
new_lines = []
Expand Down

0 comments on commit 7b1d375

Please sign in to comment.