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:
parent
47a244afe1
commit
9230e6df9b
@ -2,14 +2,18 @@
|
|||||||
|
|
||||||
import os
|
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")
|
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")
|
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")
|
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")
|
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"')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user