2021-11-25 03:19:09 +08:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
2023-12-11 21:28:09 +08:00
|
|
|
script_dir = os.path.realpath(__file__)
|
|
|
|
script_dir = os.path.dirname(script_dir)
|
|
|
|
cfg_file = os.path.join(script_dir, 'code-format.cfg')
|
|
|
|
|
2022-04-26 10:45:12 +02:00
|
|
|
print("\nFormatting demos")
|
2023-12-11 21:28:09 +08:00
|
|
|
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../demos/*.c,*.h"')
|
2022-04-26 10:45:12 +02:00
|
|
|
|
|
|
|
print("\nFormatting examples")
|
2023-12-11 21:28:09 +08:00
|
|
|
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../examples/*.c,*.h"')
|
2022-04-26 10:45:12 +02:00
|
|
|
|
2022-07-18 21:28:16 +08:00
|
|
|
print("Formatting src")
|
2023-12-11 21:28:09 +08:00
|
|
|
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../src/*.c,*.h"')
|
2022-07-18 21:28:16 +08:00
|
|
|
|
2022-04-26 10:45:12 +02:00
|
|
|
print("\nFormatting tests")
|
2023-12-11 21:28:09 +08:00
|
|
|
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../tests/*.c,*.h"')
|