From ffbd2cdb7f83ab131eb129ca2a7db670ce3c0cdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Sch=C3=BCtt?= Date: Sun, 1 Jan 2023 12:03:27 +0100 Subject: [PATCH] precommit: Check copyright banner in LICENSE files --- tools/precommit/check_file_properties.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/precommit/check_file_properties.py b/tools/precommit/check_file_properties.py index 8d96409d64..1bcf3ad4f1 100755 --- a/tools/precommit/check_file_properties.py +++ b/tools/precommit/check_file_properties.py @@ -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"