On Thu, 13 Oct 2022 at 14:38, Guillaume Nodet <gno...@apache.org> wrote:
>
> Le jeu. 13 oct. 2022 à 05:36, Olivier Lamy <ol...@apache.org> a écrit :
>
> > On Thu, 13 Oct 2022 at 02:23, Guillaume Nodet <gno...@apache.org> wrote:
> > >
> > > I'd like to propose merging the following PRs:
> > >  * https://github.com/apache/maven-shared-resources/pull/1
> > >  * https://github.com/apache/maven-site/pull/329
> > >  * https://github.com/apache/maven/pull/824
> > >  * https://github.com/apache/maven-resolver/pull/147
> > > ... and more to come
> > >
> > > The idea is to use plugins to automatically reformat the source code and
> > > sort imports to obey the maven coding style.
> > > The first PR adds the necessary resources to maven-shared-resources : a
> > new
> > > header file, as there's a requirement to put the header at the very
> > > beginning for the import sorter plugin to work correctly (else it
> > considers
> > > the license comment to be part of comment headers and screws the
> > > formatting), and the eclipse xml formatter plugin.
> > > The second PR updates the web site to point to that file which would be
> > in
> > > git instead of on the maven web site, and also updates the instruction
> > for
> > > IDEA since it has been supporting the eclipse xml config for years now).
> > > The third and fourth PRs are updates on maven and maven-resolver to apply
> > > those two plugins.
> >
> > As far as I can see Intellij supports import from checkstyle.
> > Eclipse?
> >
> > checkstyle should be the root/original format as it will be used by
> > checkstyle:check.
> > What if the intellij plugin does not integrate the last eclipse xml
> > format changes etc...
> >
> > I would prefer we focus first on the cli tools (checkstyle and/or
> > spotless) so there is no question of IDE configuration files interop.
> > It's probably better to focus on tools available for everybody.
> > (people can use netbeans, vsc etc...)
> > format issue just use spotless:apply and voila. (no need to waste time
> > finding the last IDE plugin which supports the new format from the
> > other ide etc..)
> > Please read me correctly. I do not say it's useless :) I just say it
> > shouldn’t be the priority to focus on eclipse xml format.
> >
> >
> I think what you're suggesting is exactly what I did.  Whatever tool we'd
> use to format, we'd need an input configuration file for it. That's the
> first PR.  The two last PRs are just configuring maven and maven-resolver
> to use this tool. The second PR is simply to adjust the web site to reflect
> those changes for developers to configure their IDE (IntelliJ and Eclipse)
> to match the code style.
>
> Fwiw, it seems that spotless is a maven plugin that can be used to apply a
> formatter of our choice, but we'd still have to choose and configure it.
> The discussion about IDEA / Eclipse is really about configuring IDEs in a
> way that does not go against the formatter.  And I've used the eclipse xml
> format because that's my input config file : I had to pick one, and with
> the plugins I knew, that was the easiest to use, as it was already
> available and usable.  We could change to a different formatter supported
> by spotless (google, prettier, palantir...), but for what benefit ?  I
> really don't want to spend time on finding a new formatter that can be used
> to follow the maven guidelines, and tuning its configuration when that's
> already done.

I don't mind the plugin used for auto format.
Is there any supporting checkstyle format as input? Or will we remove
checkstyle:check from the build chain?
looks not.
It's just the chaining I don;t like as this can turn into so many errors.
if I understand correctly (feel free to fix if any wrong assumption) it's:
checkstyle file -> eclipse import  (manually imported into an xx IDE
version) --> export eclipse file xml format  (manually export format
an IDE version)  -> users manual import into xxx other ide.
it;s just so much can go wrong depending on people's IDE/plugins version :)
is it sure to have no difference between importing checkstyle directly
into IDE (thinking of netbeans, vsc users...) and importing the
eclipse xml generated from checkstyle file.

but sadly if no maven plugin auto formatter supports checkstyle as
input there is not much choice....


>
> IF there's a will, we could use the spotless maven plugin instead of the
> one I've been using, I don't really mind, but I'm not sure either that
> we'll really use the additional features.  And btw, if we agree on the
> principle and on the input config, it's just a matter of switching from a
> plugin to another with the same input file, so a quite minor change really.
>
>
> >
> > >
> > > Those plugins have been used on mvnd and maven-build-cache-extension
> > > already, although they are not using a single shared resource that would
> > be
> > > added by the first PR.  Hence mvnd is still using its previous coding
> > style.
> > >
> > > Another point is that those plugins are fast and only do not process
> > files
> > > if they have been already processed and untouched since the last build.
> > So
> > > from a daily development pov, this is transparent and does not incur any
> > > additional processing time during the build (or not much really).
> > >
> > > Cheers,
> > > Guillaume
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> > For additional commands, e-mail: dev-h...@maven.apache.org
> >
> >
>
> --
> ------------------------
> Guillaume Nodet

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to