+1, I think this is a good idea. The only downside I can think of is a little bit of extra time per local build, but it seems like a worthwhile tradeoff. 2 additional suggestions: - we could consider doing this across languages as well (e.g. running the python lint and format precommits as part of compile). Go already does this automatically IIRC - we could introduce a flag for skipping these checks for faster compile/dev loop time. The difference here would be opting out of a spotless check instead of opting into it.
Thanks, Danny On Mon, Dec 2, 2024 at 3:27 AM Jan Lukavský <je...@seznam.cz> wrote: > Hi, > > there is interesting thread in Maven dev list [1], which discusses > automatic spotlessApply as part of build. I personally use exactly same > approach on other projects - i.e. compileJava depends on spotlessApply. > The benefit is that CI rarely fails due to spotless (the only > possibility is a commit that was not even compiled) and I didn't come > across any significant drawbacks. The question therefore is, should we > automatically apply spotless as part of (local) build or do we have any > reasons why not to? CI builds should use just spotlessCheck, because > local changes will not be committed nevertheless. > > Jan > > > [1] https://lists.apache.org/thread/9703k96md8lnlwnd0cz1qmqqkrkldtty > >