mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-25 20:45:19 -04:00
precommit: Add check for data/POTENTIAL file
This commit is contained in:
parent
d6dae0f410
commit
f2c59ade4c
1 changed files with 4 additions and 1 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue