1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00
lvgl/scripts/code-format.py
Neo Xu 9230e6df9b
feat(script): allow to run code-format.py outside of script/ (#4975)
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2023-12-11 14:28:09 +01:00

20 lines
631 B
Python
Executable File

#!/usr/bin/env python3
import os
script_dir = os.path.realpath(__file__)
script_dir = os.path.dirname(script_dir)
cfg_file = os.path.join(script_dir, 'code-format.cfg')
print("\nFormatting demos")
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../demos/*.c,*.h"')
print("\nFormatting examples")
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../examples/*.c,*.h"')
print("Formatting src")
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../src/*.c,*.h"')
print("\nFormatting tests")
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../tests/*.c,*.h"')