uncrustify是一个代码格式化工具,支持mac win linux平台,可单独使用,也可被第三方工具(如Source insight,Atom)调用。本文讨论MAC下的安装配置方法。
1、安装
使用homebrew安装,命令:brew install uncrustify
2、使用方法
uncrustify -h 命令可以查看使用方法,
uncrustify --show-config 命令可以列出所有配置项和配置说明
3、Atom配置方法
安装atom uncrustify插件;
在~/ 下新建 .uncrustify 目录,将配置文件(官网有默认配置文件)放到下面,改名为例如uncrustify.cfg
(详细见官网 http://uncrustify.sourceforge.net ) ,然后在atom的atom-beautify包设置里面指定uncrustify.cfg路径。
Note: Use comments containing ' *INDENT-OFF*' and ' *INDENT-ON*' to disable
processing of parts of the source file (these can be overridden with
enable_processing_cmt and disable_processing_cmt).
本文介绍uncrustify代码格式化工具的安装及配置方法,适用于macwinlinux平台。通过homebrew安装,并提供了uncrustify的基本使用命令。此外,还介绍了如何在Atom编辑器中配置该工具。

5326

被折叠的 条评论
为什么被折叠?



