From f2c59ade4c4d114d109ebe286e213198bfdfd86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Sch=C3=BCtt?= Date: Tue, 25 Aug 2020 12:11:03 +0200 Subject: [PATCH] precommit: Add check for data/POTENTIAL file --- tools/precommit/precommit.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/precommit/precommit.py b/tools/precommit/precommit.py index 651f27453b..0148aa9af5 100755 --- a/tools/precommit/precommit.py +++ b/tools/precommit/precommit.py @@ -103,7 +103,7 @@ def main(): candidate_file_list += [os.path.join(root, fn) for fn in files] # Find eligible files and sort by size as larger ones will take longer to process. - eligible_file_pattern = re.compile(r".*\.(F|fypp|c|cu|h|py|md)$") + eligible_file_pattern = re.compile(r".*(_POTENTIALS|(\.(F|fypp|c|cu|h|py|md)))$") file_list = [fn for fn in candidate_file_list if eligible_file_pattern.match(fn)] file_list.sort(reverse=True, key=lambda fn: os.path.getsize(fn)) @@ -190,6 +190,9 @@ def process_file(fn, allow_modifications): elif re.match(r".*\.md$", fn): run_remote_tool("markdownlint", fn) + elif re.match(r".*_POTENTIALS$", fn): + run_local_tool("make", "data/POTENTIAL") + else: raise Exception("Unknown file extension: " + fn)