Configure C++ Google Style in CLion IDE
Asked Answered
B

3

15

This is a rather easy matter in IntelliJ (and setting up PEP8 in PyCharm), but I have been googling and I couldn't find a configuration file (I presume in XML or whatever CLion uses) that I could use to configure it to adhere to the Google style guide.

Is this a "future feature" or am I missing something fundamental?

Of course, I can configure it manually, but it's a tedious and time-consuming operation; if someone has already done that, awesome and thanks for sharing!

Bethany answered 20/7, 2015 at 2:24 Comment(4)
I guess I have to wonder why anybody willingly uses Google Style rules. Is this for a job or for personal usage?Tapestry
well, in my case, after almost five years at Google I got used to the style :) (and, personally, I like it). But, also, I'm now working on Apache Mesos, and we follow the Google Style (with some modifications), so, yes, it's for a job too.Bethany
Well, cool. I'm just starting to learn CLion myself. I have yet needed to do this, but I was just curious if about motives :). CLion seems real awesome (like most things from IntelliJ) but as I'm sure you know, it's still not fully developed. I've ran into many issues with it myself, some things fixed in later updates.Tapestry
You can try youtrack.jetbrains.com/issue/CPP-3222 plugins.jetbrains.com/plugin/7871?pr=clion cpp-lint plugin. Code style support coming soon!Fenestrated
M
6

Go to Setting/Preferences | Editor | Code Style | C/C++ then click the button "Set from..." in the top right and select "Google."

Medullated answered 3/6, 2020 at 6:51 Comment(0)
E
5

CLion now supports this natively, as of v1.1. A blog post from JetBrains shows how to use pre-defined code styles here. Download the latest version of CLion here.

Etoile answered 27/7, 2015 at 14:33 Comment(3)
This blog post shows how to set the Google C++ Style: blog.jetbrains.com/clion/2015/07/….Coiffure
And this has been merged into the main CLion build which can be found here: jetbrains.com/clion/downloadCoiffure
Thanks for the reminder and the blog post. Both have been updated in the answer now.Etoile
F
1

You can try cpp-lint plugin. Code style support coming soon!

Fenestrated answered 22/7, 2015 at 14:34 Comment(2)
thanks for this - you may then be interested in my fork of cpp-lint: adds some much-needed functionality ;) github.com/massenz/styleguide the master branch integrates all the functionality I've added.Bethany
Please, communicate with the plugin author directly ) That is not JB project.Fenestrated

© 2022 - 2024 — McMap. All rights reserved.