13

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!

Marco Massenzio
  • 2,822
  • 1
  • 25
  • 37
  • 2
    I guess I have to wonder why anybody willingly uses Google Style rules. Is this for a job or for personal usage? – ydobonebi Jul 20 '15 at 02:38
  • 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. – Marco Massenzio Jul 21 '15 at 04:35
  • 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. – ydobonebi Jul 21 '15 at 04:49
  • You can try https://youtrack.jetbrains.com/issue/CPP-3222 https://plugins.jetbrains.com/plugin/7871?pr=clion cpp-lint plugin. Code style support coming soon! – uta Jul 22 '15 at 14:32

3 Answers3

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.

DavidZemon
  • 501
  • 5
  • 21
  • This blog post shows how to set the Google C++ Style: http://blog.jetbrains.com/clion/2015/07/new-clion-1-1-eap-select-and-use-your-favourite-code-style/. – phoenix Dec 27 '15 at 23:42
  • 1
    And this has been merged into the main CLion build which can be found here: https://www.jetbrains.com/clion/download/ – phoenix Dec 27 '15 at 23:43
  • Thanks for the reminder and the blog post. Both have been updated in the answer now. – DavidZemon Dec 28 '15 at 17:53
5

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

Higigig
  • 1,175
  • 1
  • 13
  • 25
1

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

uta
  • 1,451
  • 10
  • 12
  • thanks for this - you may then be interested in my fork of cpp-lint: adds some much-needed functionality ;) https://github.com/massenz/styleguide the `master` branch integrates all the functionality I've added. – Marco Massenzio Jul 25 '15 at 07:25
  • Please, communicate with the plugin author directly ) That is not JB project. – uta Aug 03 '15 at 14:42