spotless-intellij-gradle icon indicating copy to clipboard operation
spotless-intellij-gradle copied to clipboard

Format all files before commit

Open luisalves00 opened this issue 11 months ago • 2 comments

I usually use my personal custom formatting while coding or fixing issues, but before commit I need to execute spotlessApply before committing as the remote build process will check the formatting. Would be nice that the formatting is applied before commit.

Example: image

luisalves00 avatar Mar 23 '24 19:03 luisalves00

It can be done with a pre-commit hook using Spotless and your build management tool of choice, in-depth discussion here: https://github.com/diffplug/spotless/issues/178

pr11me avatar Apr 17 '24 07:04 pr11me

@pri-me tried the pre-commit in the past but didn't work great. Sometimes intellij hanged up and didn't figure out why. Anyway, I've already pulled the solution to https://github.com/lipiridi/spotless-applier.

luisalves00 avatar Apr 17 '24 08:04 luisalves00