From e86950d4ab656ddb5b10d2af97336ae430ab190f Mon Sep 17 00:00:00 2001 From: Leonardo Date: Wed, 13 May 2020 01:42:39 -0300 Subject: [PATCH] Update autogen.py --- autogen.py | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/autogen.py b/autogen.py index 751bca7..8c0ba1d 100644 --- a/autogen.py +++ b/autogen.py @@ -93,30 +93,9 @@ for data in collections: print(f'Generated {data["h"]: >20} -> {OUTPUT_DIR}/{data["sname"]}.c') -# This seemed to be crashing -# subprocess.run(f'clang-format --style=file -i {OUTPUT_DIR}/*.c') - -# So I guess... it will have to be called from a temp Makefile... ugh -TMP_MAKE = './temp_makefile' - -data = f''' -.PHONY: codecov FORCE - -codecov: FORCE -\tclang-format --style=file -i {OUTPUT_DIR}/*.c - -FORCE: - -''' - -print(f'Creating temporary Makefile as {TMP_MAKE}') - -file = open(TMP_MAKE, 'w') -file.write(data) -file.flush() -file.close() - -subprocess.call(['make', '-f' , TMP_MAKE, 'codecov', '--always-make']) - os.remove(TMP_FILE) -os.remove(TMP_MAKE) + +# Format all files +print('Formating files...') +subprocess.call(['clang-format', '--style=file', '-i', f'{OUTPUT_DIR}/*.c']) +print('Done')