precommit: Check copyright banner in LICENSE files

This commit is contained in:
Ole Schütt 2023-01-01 12:03:27 +01:00 committed by Ole Schütt
parent 86b6673cdf
commit ffbd2cdb7f

View file

@ -170,6 +170,8 @@ def check_file(path: pathlib.Path) -> typing.List[str]:
warnings += [f"{path}: Copyright banner malformed"]
if fn_ext in C_EXTENSIONS and not content.startswith(BANNER_C.format(year, spdx)):
warnings += [f"{path}: Copyright banner malformed"]
if path.name == "LICENSE" and bsd_licensed and f"2000-{year}" not in content:
warnings += [f"{path}: Copyright banner malformed"]
# check shebang
PY_SHEBANG = "#!/usr/bin/env python3"