mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-27 21:55:16 -04:00
precommit: Get fortitude auto-fixing to work
This commit is contained in:
parent
bfa23ca8e4
commit
6bdde325c8
2 changed files with 15 additions and 4 deletions
|
|
@ -234,10 +234,14 @@ def process_file(fn: str, allow_modifications: bool) -> None:
|
|||
run_format_fortran(fn)
|
||||
|
||||
if re.match(r".*\.F$", fn) and basename not in FORTITUDE_EXCLUDE:
|
||||
fypped_fn = SCRATCH_DIR / basename
|
||||
run_local_tool("./tools/build_utils/fypp", fn, str(fypped_fn))
|
||||
run_remote_tool("fortitude", str(fypped_fn))
|
||||
fypped_fn.unlink()
|
||||
try:
|
||||
# First try without fypp as this allows for auto-fixing.
|
||||
run_remote_tool("fortitude", fn)
|
||||
except Exception as err:
|
||||
fypped_fn = SCRATCH_DIR / basename
|
||||
run_local_tool("./tools/build_utils/fypp", fn, str(fypped_fn))
|
||||
run_remote_tool("fortitude_nofix", str(fypped_fn))
|
||||
fypped_fn.unlink()
|
||||
|
||||
if re.match(r".*\.(c|cu|cl|h)$", fn):
|
||||
run_remote_tool("clangformat", fn)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue