有 c++ 的样式检查器吗?

发布于 2024-09-17 20:37:00 字数 155 浏览 7 评论 0原文

我已经使用 java 一段时间了,我发现 checkstyle 非常有用。我开始使用 c++,我想知道是否有具有类似功能的样式检查器。我主要寻找编写定制支票的能力。

I have worked with java for a while now, and I found checkstyle to be very useful. I am starting to work with c++ and I was wondering if there is a style checker with similar functionality. I am mainly looking for the ability to write customized checks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

无力看清 2024-09-24 20:37:00

Vera++ 怎么样?

Vera++ 是一个用于验证、分析和转换 C++ 源代码的可编程工具。
Vera++ 主要是一个解析 C++ 源文件的引擎,并将解析结果以各种集合的形式呈现给脚本 - 脚本实际上正在执行请求的任务。

点击 此处查看其功能的更完整演示。

crc.hpp:157: keyword 'explicit' not followed by a single space
crc.hpp:588: closing curly bracket not in the same line or column
dynamic_property_map.hpp:82: keyword 'if' not followed by a single space
functional.hpp:106: line is longer than 100 characters
multi_index_container.hpp:472: comma should be followed by whitespace
version.hpp:37: too many consecutive empty lines
weak_ptr.hpp:108: keyword 'catch' not followed by a single space
...

What about Vera++ ?

Vera++ is a programmable tool for verification, analysis and transformation of C++ source code.
Vera++ is mainly an engine that parses C++ source files and presents the result of this parsing to scripts in the form of various collections - the scripts are actually performing the requested tasks.

Click here to see a more complete demo of what it can do.

crc.hpp:157: keyword 'explicit' not followed by a single space
crc.hpp:588: closing curly bracket not in the same line or column
dynamic_property_map.hpp:82: keyword 'if' not followed by a single space
functional.hpp:106: line is longer than 100 characters
multi_index_container.hpp:472: comma should be followed by whitespace
version.hpp:37: too many consecutive empty lines
weak_ptr.hpp:108: keyword 'catch' not followed by a single space
...
弄潮 2024-09-24 20:37:00

我对 艺术风格 得到了很好的反馈,它允许在代码上应用统一的风格,而无需太多麻烦。

它是免费的,并且已经定义了很多“经典”样式。但它可能不适用于 C++0x 新构造。

我也期待一个 Clang 库,尽管迄今为止我还没有找到。通常,考虑到 Clang 的结构,它应该相对容易,但说起来总是比编码容易,我猜还没人花时间。

I have had good feedback about Artistic Style which allows to apply a uniform style on code without too much hassle.

It's free and there are plenty of "classic" styles already defined. It might not work with C++0x new constructs though.

I am also expecting a Clang library, though I haven't found any to date. Normally, given Clang's structure it should be relatively easy, but then it's always easier to say than to code and I guess nobody took the time yet.

风启觞 2024-09-24 20:37:00

KWStyle 似乎是一个轻量级的适合

KWStyle seems to be a lightweight fit

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文