Advanced code style in Clion

468 Views Asked by At

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?

1

There are 1 best solutions below

0
On BEST ANSWER

Yeah, you able to do this! Look into Clion plug-in Clion-cpplint and use with cpplint.py script, provided by Google. You will get highlights on the fly when you are editing C++ source code.

You able to install add-on through Plugins tab in settings. In the end you will get something like: hightlights-example1 hightlights-example2