At present, the IntelliJ IDEA project setup has some manual steps - see Import additional code style section of the Working with the Code wiki page that refers to idea/codeStyleConfig.xml.
This step could be a bit easier by checking in this file in version control under it's natural place (that is, under .idea/codeStyles). This is also suggested by Jetbrains - see the article on How to manage projects under Version Control Systems.
The manual step on project setup isn't the only downside of the current setup: - any updates to the file from the team require manual export (since it's natural location is git ignored) - contributors need to re-import to pick up any updates
Additionally, on top of the code style config, some additional things like inspection profiles could also be shared. For example, the Instance field access not qualified with 'this' inspection is helpful because IDEA will then qualify fields with this when it generates any code (for instance, field accessors). This helps because it prevents Checkstyle errors and therefore saves time.
Basically, I'm proposing to ditch the mentioned manual step in favor of checking in .idea/codeStyles and .idea/inspectionProfiles directories. In terms of .gitignore that boils down to something like this:
!.idea/
.idea/*
!.idea/codeStyles
!.idea/inspectionProfiles
Comment From: dreis2211
Why not just use and extend the .editorconfig instead?
Comment From: anilkumarkatta204
Also, may be add pre-requiste details for PKIX Certificate Issues, when configuring the unsecured environments.
Comment From: snicoll
In the past, importing a project with an existing .idea directory led to a change of behavior in the way updates were applied so we'd have to test this first.
Comment From: vpavic
I've opened a draft PR to take a look at this - see #29446.
... led to a change of behavior in the way updates were applied ...
@snicoll, can you clarify this? I'm not sure I understood what behavior and updates exactly did you refer to.
Why not just use and extend the
.editorconfiginstead?
@dreis2211 I like .editorconfig as means of ensuring basic settings are respected everywhere but find it less attractive for expressing richer capabilities of IDE like IntelliJ as it will never be able to do the same job there.
Comment From: snicoll
can you clarify this?
I can't without testing it. I've tried to do such a thing in the past and the IDE had a different behavior with regards to updating the project configuration when something in the build changes that led the IDE to be out-of-sync.
Comment From: dreis2211
@vpavic I was under the impression that you can export IDEA settings either via xml or .editorconfig and that the functionality is equivalent...
Comment From: vpavic
... you can export ...
Exactly the reason why I'm proposing this, to avoid the need to export (or import) settings. Requiring manual actions makes both the project setup and the maintenance of these settings more difficult.
While I generally like EditorConfig as a way of ensuring baseline code style IMO it's not as good as native configuration because: - it requires another IDE plugin - if used as a dumping group for various editor/IDE-specific settings it becomes messy and therefore difficult to maintain - it cannot (to my knowledge) cover stuff like inspection settings
Comment From: snicoll
Closing in favor of PR https://github.com/spring-projects/spring-boot/pull/29446