问题描述
我们正在使用IntelliJ IDEA 10.5。我们如何确保每个人都使用相同的代码样式和重新排列配置?应该在版本控制下放置哪些文件?
We are using IntelliJ IDEA 10.5. How can we ensure that everyone is using the same code style and Rearranger configuration? What files should be put under version control?
推荐答案
您应该共享中的大部分文件.idea
使用基于目录的格式时的目录,。
You should share most of the files in .idea
directory when using the directory based format, check the FAQ.
在使当前方案项目具体,它将存储在 .idea / codeStyleSettings.xml
(或项目 .ipr
使用旧格式时的文件。)
In the Code style settings make the current scheme project specific, it will be stored in .idea/codeStyleSettings.xml
(or project .ipr
file when using the legacy format).
Rearranger是第三方插件,据我所知不会将其配置存储在项目。它具有从文件导入配置并将其导出到文件的选项,您可以通过将此文件放在版本控制中来维护相同的配置。
Rearranger is a third-party plug-in and as far as I know doesn't store its configuration inside the project. It has options to import configuration from a file and export it to a file which you can use to maintain the same configuration by putting this file in the version control.
请注意IDEA 12将捆绑一个新的Rearranger插件,该插件将具有更好的配置管理(类似于代码样式设置或其中的一部分)。
Note that IDEA 12 will bundle a new Rearranger plug-in which will have better configuration management (similar to the code style settings, or a part of it).
这篇关于IntelliJ-IDEA:如何强制执行相同的代码样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!