We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed last year.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
Google 使用 cpplint。这是他们的风格指南。
Google uses cpplint. This is their style guide.
Linux 内核使用一个工具来完成此任务 - 它称为
checkpatch
。您必须修改它才能检查您的编码标准而不是他们的编码标准,但这可能是一个很好的工作基础。 (它也是为 C 代码而不是 C++ 设计的)。The Linux kernel uses a tool that does exactly this - it's called
checkpatch
. You'd have to modify it to check your coding standards rather than theirs, but it could be a good basis to work from. (It is also designed for C code rather than C++).看看Vera++,它有很多规则 已经可用,但好的部分是您可以修改它们或编写自己的规则。
Take a look at Vera++, it has a number of rules already available but the nice part is that you can modify them or write your own.
有几个程序可以在保存时自动为您进行格式化(例如 Eclipse)。您可以拥有每个人都可以使用的格式设置,以确保相同的格式。
提交代码时也可以自动应用此类格式。当您使用 SVN 时,执行此操作的系统称为 svn hooks。这基本上会启动一个程序来在提交发生时处理(或检查和拒绝)格式。
此网站说明了如何制作自己的网站。但也已经存在这样做的方法。
There are several programs that can do formatting for you automatically on save (such as Eclipse). You can have format settings that everyone can use ensuring the same formatting.
It is also possible to automatically apply such formatting when code is committed. When you use SVN, the system to do this is called svn hooks. This basically starts a program to process (or check and deny) the formatting when a commit happens.
This site explains how you can make your own. But also ones already exist to do this.