1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

feat(script): allow to run code-format.py outside of script/ (#4975)

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
Neo Xu 2023-12-11 21:28:09 +08:00 committed by GitHub
parent 47a244afe1
commit 9230e6df9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,14 +2,18 @@
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('astyle --options=code-format.cfg --recursive "../demos/*.c,*.h"')
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../demos/*.c,*.h"')
print("\nFormatting examples")
os.system('astyle --options=code-format.cfg --recursive "../examples/*.c,*.h"')
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../examples/*.c,*.h"')
print("Formatting src")
os.system('astyle --options=code-format.cfg --recursive "../src/*.c,*.h"')
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../src/*.c,*.h"')
print("\nFormatting tests")
os.system('astyle --options=code-format.cfg --recursive "../tests/*.c,*.h"')
os.system(f'astyle --options={cfg_file} --recursive "{script_dir}/../tests/*.c,*.h"')