Obviously it's best to not let improperly formatted code into the repo to
begin with, but we can give this a try and see how it works out in practice.



On Sun, May 1, 2022 at 1:35 PM Otavio Rodolfo Piske <[email protected]>
wrote:

> Hello Jeremy,
>
> I agree with you that moving to a manual check of the format can lead to
> more non-compliant code.
>
> To reduce this risk, I have reworked a Gtihub action that we had before, so
> that it automatically checks for code formatting violations [1]. If any
> formatting violation is found, then it sends a PR with the changes [2].
> Currently this is being done for every push to main. I am keeping an eye on
> it to ensure it doesn't flood us with PRs (there was an initial burst of
> PRs on the first day, but it seems to have settled so far).
>
> What do you think about this approach?
>
> 1.
>
> https://github.com/apache/camel/blob/main/.github/workflows/main-push-build.yml
> 2. (Here's an example): https://github.com/apache/camel/pull/7534
>
> Kind regards
>
> On Sat, Apr 30, 2022 at 10:12 PM Jeremy Ross <[email protected]>
> wrote:
>
> > I suspect that sorting/formatting by default was fairly effective at
> > keeping the codebase compliant with standards. If a certain maven profile
> > is required to format and/or sourcecheck, it seems that we'll end up with
> > more non-compliant code.
> >
> > I know we're trying to speed up build times, so is there some other way
> we
> > can check formatting? Commit hooks, etc.?
> >
> > On Tue, Apr 26, 2022 at 4:02 AM Otavio Rodolfo Piske <
> [email protected]
> > >
> > wrote:
> >
> > > Hello,
> > >
> > > Just as a heads up, as part of the work on CAMEL-17894, there was a
> > change
> > > in the plugins running by default on our build.
> > >
> > > Previously, the code would run the import sorting + code formatting by
> > > default. This behavior was now moved to the "format" profile. As such,
> to
> > > both format and run the fastinstall, you should use:
> > > "mvn -Pformat,fastinstall".
> > >
> > > Please, reach out if you find any problems with the above behavior.
> > >
> > > Kind regards
> > > --
> > > Otavio R. Piske
> > > http://orpiske.net
> > >
> >
>
>
> --
> Otavio R. Piske
> http://orpiske.net
>

Reply via email to