mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-27 13:45:19 -04:00
Move prettify into precommit folder and inline fprettify submodule
This commit is contained in:
parent
7f52ba2b1e
commit
9a20f053d1
16 changed files with 3400 additions and 15 deletions
|
|
@ -86,6 +86,8 @@ def main() -> None:
|
|||
continue
|
||||
if root.startswith("./tools/prettify/fprettify"):
|
||||
continue
|
||||
if root.startswith("./tools/precommit/fprettify"):
|
||||
continue
|
||||
if root.startswith("./tools/build_utils/fypp"):
|
||||
continue
|
||||
if root.startswith("./tools/autotools"):
|
||||
|
|
@ -194,7 +196,7 @@ def process_file(fn: str, allow_modifications: bool) -> None:
|
|||
|
||||
if re.match(r".*\.(F|fypp)$", fn):
|
||||
run_local_tool("./tools/doxify/doxify.sh", fn)
|
||||
run_prettify(fn)
|
||||
run_format_fortran(fn)
|
||||
|
||||
if re.match(r".*\.(c|cu|cl|h)$", fn):
|
||||
run_remote_tool("clangformat", fn)
|
||||
|
|
@ -248,13 +250,13 @@ def process_file(fn: str, allow_modifications: bool) -> None:
|
|||
|
||||
|
||||
# ======================================================================================
|
||||
def run_prettify(fn: str) -> None:
|
||||
def run_format_fortran(fn: str) -> None:
|
||||
if fn in ("./src/base/base_uses.f90", "./src/common/util.F"):
|
||||
return # Skipping because of prettify bugs.
|
||||
|
||||
# The prettify tool processes only about 1k lines of code per second.
|
||||
# Hence, setting a generous timeout as our largest file has 100k lines.
|
||||
run_local_tool("./tools/prettify/prettify.py", fn, timeout=600)
|
||||
run_local_tool("./tools/precommit/format_fortran.py", fn, timeout=600)
|
||||
|
||||
|
||||
# ======================================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue