Precommit: Format spack packages with upstream style

This commit is contained in:
Ole Schütt 2025-05-22 15:31:23 +02:00 committed by Ole Schütt
parent 899741eeca
commit 6d377b8c9f
5 changed files with 31 additions and 73 deletions

View file

@ -216,7 +216,10 @@ def process_file(fn: str, allow_modifications: bool) -> None:
if re.match(r"(.*/PACKAGE)|(.*\.py)$", fn):
ast.parse(orig_content, filename=fn)
run_remote_tool("black", fn)
if "tools/spack/packages" in fn:
run_remote_tool("spackformat", fn)
else:
run_remote_tool("black", fn)
if re.match(r".*\.sh$", fn):
run_remote_tool("shfmt", fn)