From 7b1d37508b99b898fcd5cce41fc229f907ce7619 Mon Sep 17 00:00:00 2001 From: belthlemar Date: Wed, 18 Sep 2024 10:29:17 +0200 Subject: [PATCH] change script --- scripts/license_checker_and_adder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/license_checker_and_adder.py b/scripts/license_checker_and_adder.py index 31442416c3..5fbfff0eeb 100755 --- a/scripts/license_checker_and_adder.py +++ b/scripts/license_checker_and_adder.py @@ -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 = []