1

I want to have google-style like code style checker that would automatically run within Clion.

However, what I found as solutions (predeclared code style for google and others, direct Editor settings and EditorConfig support in Clion help) are all rather primitive. For example, I want to use snake case with final underscore for class member fileds (e.g. my_class_member_) and usual snake case for function arguments (e.g. some_argument), and none of the suggested options would do the trick as far as I am concerned. Furthermore, some politics associated with endless loops and so are to be added, which is even more context-specific.

I consider creating cpplint.py-like script for this, but it is going to be very time-consuming and is likely to be run outside Clion. Are there any elegant ways to solve my problem?

4

1 回答 1

2

是的,你可以做到这一点!查看 Clion 插件Clion-cpplint并与谷歌提供的cpplint.py 脚本一起使用。当您编辑 C++ 源代码时,您将即时获得高亮显示。

Plugins您可以通过设置中的选项卡安装附加组件。最后你会得到类似的东西:亮点-example1 亮点-example2

于 2017-09-25T08:50:18.000 回答