Skip to content
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

Format all files before commit #52

Open
luisalves00 opened this issue Mar 23, 2024 · 2 comments · May be fixed by #53
Open

Format all files before commit #52

luisalves00 opened this issue Mar 23, 2024 · 2 comments · May be fixed by #53

Comments

@luisalves00
Copy link

luisalves00 commented Mar 23, 2024

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

@pri-me
Copy link

pri-me commented Apr 17, 2024

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

@luisalves00
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants