Astyle 参数设置
Written By Tomy Stark.
E-mail: ro7enkranz@qq.com
Ver 1.0.0Note:
- 转载请注明本文出处链接、作者
A. *.bat批处理文件调用Astyle进行代码格式化[KR风格]
1. 一键格式化所有代码(包括子目录)_完整参数版
1 | for /R %%f in (*.c;*.h) do AStyle.exe --style=kr --indent=spaces=4 --attach-closing-while --indent-switches --indent-preproc-define --indent-col1-comments --max-continuation-indent=60 --break-blocks --pad-oper --pad-comma --pad-header --align-pointer=name --align-reference=name --break-one-line-headers --add-braces --attach-return-type --attach-return-type-decl --convert-tabs --max-code-length=200 --suffix=none --verbose %%f |
2. 一键格式化所有代码(包括子目录)_短参数版
1 | for /R %%f in (*.c;*.h) do AStyle.exe -A3 -s4 -xV -S -w -Y -M60 -f -p -xg -H -k3 -W3 -xb -j -xf -xh -c -xC200 -n -v %%f |
B. Keil调用Astyle进行代码格式化[KR风格]
1 |
|
C. Eclipse系IDE调用Astyle进行代码格式化[KR风格]
(例如 S32 Design Studio, MCUXpresso IDE, TrueStudio, TI Code Composer Studio, Xilinx SDK ……)
位置(例如AStyle放置于以下目录时)
D:\Software\AStyle\bin\AStyle.exe工作目录
${workspace_loc:/${project_name}}自变量
1 |
|