About dropping `ratchetFrom`, it is totally legitimate in my perspective.
`ratchetFrom` is often a good way to wire Spotless, delaying the big-bang
until the project is happy with spotless configuration.

> 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
Cleanthat is currently following a Apache License 2 (
https://github.com/solven-eu/cleanthat/blob/master/.cleanthat/spotless.license
)
CleanThat-GithubApp offers alternative engine to spotless (e.g.
OpenRewrite, Eclipse Cleanup (however I'm working into integrating those in
Spotless (https://github.com/diffplug/spotless/pull/1587)))
Many projects have difficulties enabling commit+push into github-actions
(essential around secrets management). Hence, the GithubApp makes this
trivial.
The GithubApp may also be snappier in committing the fixed files, as it
relies on webhooks from Github (hence not cloning the repo (not even the 31
latest commits)).

Cleanthat core-feature is linting Java (e.g. a recent mutator turns
foreach+if into if+stream.anyMatch). Such code changes are out of
pure-formatting scope (but available already through Spotless).
Contrary to formatting (which stylesheet is supposed to be stable), linting
rules are dynamic (following contributions (essentially myself at the
moment)). One may prefer having a Github app applying them through
dedicated PRs, instead of linting each PR which code-changes. With
spotless, one would need regular small-big-bangs, applying new relevant
linting-rules (which is fine for some projects).

Thanks
--
Benoit Lacelle

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