简体   繁体   中英

Advanced code style in Clion

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 (eg my_class_member_) and usual snake case for function arguments (eg 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?

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-例1hightlights-例题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM