- Notifications
You must be signed in to change notification settings - Fork1.7k
Use spotless to enforce style and apply#1712
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
juherr commentedSep 4, 2025
@ctrimble I’m not sure applying the style all at once is a good idea, but I wanted to show the impact and highlight whether the |
232a591 tod0366eeComparectrimble commentedSep 4, 2025
@juherr Thanks for submitting this. but it is a distraction right now. I will take a look when the backlog is more in order. |
juherr commentedSep 4, 2025
Sure, it is not urgent |
eirnym commentedSep 5, 2025
I'll add my 2 groszy to the discussion. Back in the day I've resigned from spotless plugin both at work and in personal projects because it's annoying: you need to hack a solution to test if it works and… you have to format. Additionally, it take too much time to run, so no rapid development either. We at work and I in my personal projects usually on commit or even on push (depending on team and project), so pre-commit (or any similar project) checked both locally and on CI works the best. |
juherr commentedSep 5, 2025
@eirnym I didn’t bind the plugin to any Maven phase and added a CI check as you suggested. That’s exactly what you had in mind, right? |
eirnym commentedSep 5, 2025
I haven't read Spotless for a while now, but AFAIK it binds itself to the build phase like it was back in the day. It's easy to check: just make code less pretty and build the project |
juherr commentedSep 5, 2025
I’ve been using Spotless on many of my projects and haven't run into the issue you mentioned. ;) |
eirnym commentedSep 6, 2025
I've checked documentation and it's not automatic as you've said. But it's a separate non-automated execution which is still not ideal. It's easy to forget run It's possible to write a manual pre-commit hook, but it's still not automated. |
juherr commentedSep 7, 2025
eirnym commentedSep 8, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yes, I did. It's not so easy to manage (keep, install, update) and it's not extensible as pre-commit is. It's may be ok for a very small project which won't add any other pre commit hooks ever. In teams and in project I work, this tool was replaced with almost direct run of formatters spotless calls. |
eirnym commentedSep 9, 2025
as of specific hooks to use for format, I recommend to look at this one:https://github.com/macisamuele/language-formatters-pre-commit-hooks |
ctrimble commentedOct 16, 2025
As an alternative location to bind this, I have a format lifecycle published. I haven't used it in a while, but we could add an |
juherr commentedOct 17, 2025
@ctrimble What do you mean exactly? |
ctrimble commentedOct 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@juherr We could addhttps://github.com/ctrimble/maven-format-lifecycle to the project. Then we would have I haven't messed with that in a few years, but I am not aware of any breaking changes in maven that have broken lifecycle plugins. |
No description provided.