Sharing Code Styles

Is there a way to share an IDEA Code Style among a team of developers?

Whichever way I try to configure it, Code Style informations never make it to IML, IPR or IWS.

How do you guys keep Code Styles consistent accross a project?

-nodje

8 comments
Comment actions Permalink

Hello nodje,

Is there a way to share an IDEA Code Style among a team of developers?

Whichever way I try to configure it, Code Style informations never
make it to IML, IPR or IWS.


How exactly did you try? If you go to Project Code Style and select "Use
per-project code style scheme", the code style scheme will be stored in the
.ipr.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"




0
Comment actions Permalink

well, I went to Project Code Style and select "Use
per-project code style scheme", then named my new CodeStyle, export it so that I can use it for other projects.
Then I tried to commit my project, expected IPR or IML to show up as modified, but they didn't!
I then searched projects files for my newly named CodeStyle, but coudn't find occurrence.
I figured CodeStyle were stored somewhere else.

but, hum, good news anyway. I'll try again.

thanks

0
Comment actions Permalink

Hello nodje,

well, I went to Project Code Style and select "Use

per-project code style scheme", then named my new CodeStyle, export it
so that I can use it for other projects.

Then I tried to commit my project, expected IPR or IML to show up as
modified, but they didn't!


You need to press "Save All" to ensure that the .ipr with your new scheme
is written out to disk.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

OK, I finally got a PER_PROJECT_SETTINGS element set in CodeStyleSettingsManager component in the IPR files.
The good thing is that I can share it among all projects.

I'm wondering if that behavior is also available for the Error Profiles.
The way I understand it, if you choose to use an IDE Profiles, then all your projects can use the same Profile, but you cannot share it with other team members.
If you use a Project Error Profile, you can share it with your team members but not between projects.
Am I missing something here?

-nodje

0
Comment actions Permalink

Hello nodje,

OK, I finally got a PER_PROJECT_SETTINGS element set in
CodeStyleSettingsManager component in the IPR files.

The good thing is that I can share it among all projects.

I'm wondering if that behavior is also available for the Error
Profiles.

The way I understand it, if you choose to use an IDE Profiles, then
all your projects can use the same Profile, but you cannot share it
with other team members.

If you use a Project Error Profile, you can share it with your team
members but not between projects.


The situation with project error profiles is exactly the same as with code
style schemes. You can save a project error profile as an IDE profile locally
and then copy it to a different project by opening the other project and
saving the profile as a project profile in the second project.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

It sure works this way.
But you have no way to propagate automatically modification on one project Error Profiles to the other, do you?

I thought changing a per-project CodeStyle would automatically benefit all other projects using that code style. But now that you mention it, I realize you probably have to export a modification and reimport it in each every project you want to use that updated Codestyle.

Then how can you ensure a company wide consistant ErrorProfile and CodeStyle?

Wouldn't it be great to have an "IDE level" ErrorProfile & CodeStyle that could be shared among project and reflect modification made in one project to all other projects?

best
-nodje

0
Comment actions Permalink

Hello nodje,

It sure works this way.
But you have no way to propagate automatically modification on one
project Error Profiles to the other, do you?
I thought changing a per-project CodeStyle would automatically benefit
all other projects using that code style. But now that you mention it,
I realize you probably have to export a modification and reimport it
in each every project you want to use that updated Codestyle.

Then how can you ensure a company wide consistant ErrorProfile and
CodeStyle?

Wouldn't it be great to have an "IDE level" ErrorProfile & CodeStyle
that could be shared among project and reflect modification made in
one project to all other projects?


We will have a better solution for this in version 8. But in version 7, there
are simply not enough concepts to implement such a solution. :) You definitely
don't want to propagate any profile change made by any developer to all projects
in the company, or to all of your personal projects that you work on in the
same IDEA instance.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thanks Dmitry.
good to know there will be something new in v8.

-nodje

0

Please sign in to leave a comment.