ci(utils/fileHeaders): added one time run script to generate file headers
This commit is contained in:
17
utils/fileHeaders/run_format_headers.py
Executable file
17
utils/fileHeaders/run_format_headers.py
Executable file
@@ -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()
|
||||
Reference in New Issue
Block a user