precommit: fix check_file_properties

Calling it with multiple filenames was broken, revised and modernized
the script in the process. The cloud-based precommit was running it on
all files even though it was never intended to work on shell scripts.
Fixed that as well.
This commit is contained in:
Tiziano Müller 2021-06-25 17:44:14 +02:00 committed by Tiziano Müller
parent 5f69bebd65
commit f511d51f6f
2 changed files with 120 additions and 117 deletions

View file

@ -200,7 +200,8 @@ def process_file(fn, allow_modifications):
if re.match(r"./data/.*POTENTIALS?$", fn):
check_data_files()
run_check_file_properties(fn)
if re.match(r".*\.(F|fypp|c|cu|cpp|h|hpp)$", fn):
run_check_file_properties(fn)
new_content = Path(fn).read_bytes()
if new_content == orig_content: