Rearange code, code cleanup, reformat code sharing and running before git commit.
Answered
Hay,
I want to share Rearange code, code cleanup, reformat code intellij settings for all persons in our company to have the same settings.
Additionally I also want to run this 3 features before git commit for all changed files.
How I should do it ?
P.S. I tried to use .editorconfig file but he can't keep information about code rearanging settings.
Please sign in to leave a comment.
See https://intellij-support.jetbrains.com/hc/articles/206544839. IDE code style can be stored in a project and shared with it: https://github.com/JetBrains/intellij-community/tree/master/.idea/codeStyles.
> I want to share Rearrange code, code cleanup, reformat code sharing IntelliJ settings
See https://youtrack.jetbrains.com/issue/IDEA-178045
> Additionally I also want to run this 3 features before git commit for all changed files.
Please clarify. The actions are currently executed on all files included into the commit. Do you want a different behavior? Why?
@Serge Baranov
But how should I generate this code settings styles directory in my .idea dir because I dont have it by default.
@Dmitriy Smirnov
Now I know that I can run some action before and after commit.
So I just need to somehow export my intellij settings releted with that 3 settings, share it (it should be easy bcs we use git), and automagically import that settings throught intellij.
See https://www.jetbrains.com/help/idea/configuring-code-style.html:
> You can copy the IDE scheme to the current project, using the Copy to Project... command.
Thanks a lot. Problem solved :)
Hey Patryk Janik can you please share how did you manage to export these settings, "Before Commit" or "Actions on Save", I've checked links above but didn't find a way to do that
Hello Vladislav Fedotov
Please see for "Actions on save":
https://youtrack.jetbrains.com/issue/IDEA-276784
also see and vote for "before commit" settings:
https://youtrack.jetbrains.com/issue/IDEA-167424