Hi Benoit,

On Tue, 7 Mar 2023 at 08:46, Benoit Lacelle <benoit.lace...@solven.eu> wrote:
> Log4J2 team may decide to drop ratchetFrom feature, it would lead to a
> massive refactoring. I would not advise doing so.

I think this is the way we should go. Ratcheting has two disadvantages:

 * it doesn't work outside of a Git working tree (e.g. the source archive),
 * contributors need to fix formatting they didn't break.

> Cleanthat proposes a Github app to automatically fix PullRequests around
> Spotless configuration. https://github.com/marketplace/cleanthat/ It would
> help fixing such situations by cleaning automatically all files of a given
> PR (especially around lines not relevant to the PR author (e.g. fixing the
> license Header)).

I am not against using other Github applications, especially if their
code is ASL.
What does CleanThat propose more than a Github Actions step like this:

run: ./mvnw spotless:check || ./mvnw spotless:apply && git commit -m
"Spotless" && git push

?

> However, it would not cover
> https://github.com/apache/logging-log4j2/issues/1317 (as it is actually an
> issue in a fork of a fork of Log4J2 repository, and the PR has the fork as
> base, while Cleanthat Github app would cover PR with Log4J2 as base
> repository).

That is just a typo in the configuration.

> FYI, I pushed this case to @nedtwig (Spotless author). We agreed the use of
> ratchetFrom with HEAD~31 and `fetch-depth: 32` is *very clever*.

This is the only way for ratchet to work in Github Actions *without*
cloning the whole history of the repository. I think we never had more
than 16 commits pushed at the same time, so 32 should cover all cases.

Piotr

Reply via email to