astyle、clang-formta代码格式化工具

astyle

https://astyle.sourceforge.net/

一篇比较好的中文介绍
https://blog.csdn.net/weixin_39950873/article/details/131635456

总结的一套配置

style_format:
@find (dir) \
-name "*.c" -o -name "*.h" | \
xargs astyle --style=kr \
--indent=spaces=4 \
--indent-switches \
--indent-after-parens \
--indent-preproc-define \
--indent-col1-comments \
--attach-closing-while \
--attach-return-type \
--pad-oper \
--pad-header \
--unpad-paren \
--delete-empty-lines \
--squeeze-lines=2 \
--squeeze-ws \
--add-braces \
--align-pointer=name \
--align-reference=name \
--convert-tabs \
--lineend=linux \
--suffix=none

clang-format

官方配置选项解释 https://clang.llvm.org/docs/ClangFormatStyleOptions.html
kernel clang-format介绍 https://www.kernel.org/doc/html/next/process/clang-format.html
一篇比较好的中文总结 https://zhuanlan.zhihu.com/p/641846308

posted @   zephyr~  阅读(175)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· DeepSeek在M芯片Mac上本地化部署
点击右上角即可分享
微信分享提示