最近开发的灵活的 C++ 有什么好的吗?风格检查器?

发布于 2024-12-19 11:09:22 字数 388 浏览 1 评论 0原文

我知道这个问题已经在这里提出过,但它是从 2010 年开始的我想知道是否有人知道最近制作的一些作品。

我正在考虑使用样式检查器来帮助在我当前的工作场所强制执行编码约定。我看到以下几个选项:

  1. 存在一种强制执行差异样式约定的灵活方式。 Vera++ 看起来很有趣并且可扩展。
  2. 使用/破解 Google 的 cpplint 样式检查器(看起来令人畏惧)
  3. 访问当前文件的解析树(最好是 AST)并对其执行检查。

#3 似乎是最灵活的,想知道是否有人知道挂钩 AST 的程序或方法?

I know this question has been asked here, however it was from 2010 and I was wondering if anybody knows of some recent ones made.

I'm looking into using a style checker to help enforce coding conventions at my current workplace. I see the following few options:

  1. A nice flexible way to enforce difference style conventions exist. Vera++ looked interesting and extendable.
  2. Use/hack Google's cpplint style checker (seems daunting)
  3. get access to the parse tree (preferably the AST) of the current file and perform checks on that.

#3 seems the most flexible and wondering whether anyone knows of a program or way to hook into the AST?

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

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

发布评论

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

评论(2

絕版丫頭 2024-12-26 11:09:22

尝试使用 clang 和所有警告打开 xCode。
您还可以让 clang 转储 AST。

Try xCode with clang and all warning on.
You can also make clang dump the AST.

摘星┃星的人 2024-12-26 11:09:22

CppCheck 构建一个 AST。它还允许您编写插件,您可以在其中访问 AST。但如上所述,它可能会擦除检查样式所需的必要信息。我的选择是自定义cpplint。

CppCheck build an AST. And it also allows you to write addons, where you can get access to AST. But as stated above it may wipe necessary information needed to check style. My choice is to customize cpplint.

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