-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Meta] Gradle build script enables IntelliJ "Reformat code" on save? #86
Comments
Probably relates to palantir/palantir-java-format#1111 |
If you don't install the
Basically this. We use palantir-java-format in all of our repos to provide consistent formatting. Any questions about palantir-java-format are better suited for that repo. |
Unfortunately that is exactly what is happening. Have created palantir/palantir-java-format#1190 for that now. |
What happened?
It seems somehow the Gradle build script of this project enable IntelliJ "Actions on save" > "Reformat code" (please correct me if I am wrong and something else is enabling this), and even keeps re-enabling it after you disable it.
IntelliJ warned me that "Required plugins have not been loaded" ('CheckStyle-IDEA' and 'palantir-java-format') when I loaded the project. But I chose not to install these plugins because I was hoping to to only make smaller changes, and be able to fix all formatting violations using a Gradle task, not having to get familiar with two additional IntelliJ plugins.
Maybe because I don't have these plugins installed, when IntelliJ now automatically formats the code (which as mentioned above, I cannot disable permanently) it introduces large amounts of whitespace changes. And this unfortunately often before I was able to commit my changes.
So currently it feels like I am constantly fighting IntelliJ / the Gradle build script to not mess with the formatting.
What did you want to happen?
Not completely sure, but I find the current setup a bit intrusive, and the reformatting interferes with making changes (e.g. you get a massive whitespace diff on commit).
I was rather hoping that I did not have to install these IntelliJ plugins for smaller changes, and if necessary the Gradle build would inform me about formatting violations, and ideally there was a task which I could run to fix them.
So that I could make all my changes (without having to pay close attention to formatting, or IntelliJ auto-formatting the code), and then in the end run a Gradle build and fix formatting violations.
Though maybe the Gradle build script is really more suited for Palantir members, who already have these IntelliJ plugins installed, and for whom all of this is normal and familiar?
The text was updated successfully, but these errors were encountered: