diff --git a/utils/fileHeaders/run_format_headers.py b/utils/fileHeaders/run_format_headers.py new file mode 100755 index 0000000..b4100f2 --- /dev/null +++ b/utils/fileHeaders/run_format_headers.py @@ -0,0 +1,17 @@ +import pathlib +import os +import subprocess + +def run_format_headers(): + root = "../../src" + script = "../../commit-config/hooks/formatHeader.py" + + validExtensions = [".c", ".h", ".cpp", ".hpp", ".py", ".f", ".f90"] + + for path in pathlib.Path(root).rglob("*"): + if path.is_file() and path.suffix in validExtensions: + print(f"Adding header to: {path}") + subprocess.run(["python", script, str(path)], stdout=subprocess.PIPE) + +if __name__ == "__main__": + run_format_headers() \ No newline at end of file