Skip to content

Maven Plugin global ratchetFrom not working with multiple formatters #664

Closed
@stephen-smith

Description

@stephen-smith

Maven Plugin global ratchetFrom not working with multiple formatters

I have a "global" ratchetFrom like <configuration><ratchetFrom>A_SHA_HASH</ratchetFrom>... and both a "java" and a "formats" section. Under the "formats" there are two "format"s. All 3 use using prettier, with different plugins, parsers, options, and (non-overlapping) includes.

In the above case, I got an error from spotless:check for a file that that not been changed since the ratchet point. I thought that it might just be a problem with prettier or one of the sub-configurations. So, I copied the ratchetFrom into the format that covered the file it was complaining about. The first error went away, but I got an error from the other format, about another file that has not been changes since the ratchet point. I repeated the process, but ended up having to copy the ratchetFrom into both "format" elements and the "java" element.

Finally, spotless behaved as expected. I then removed the global ratchedFrom, and it was still successful.

The documentation clearly says ratchetFrom is supposed to work "globally", and may (but is not required to be) specified on each format as well: https://github.com/diffplug/spotless/tree/a1b5e90a9d0788bcc5a651ae424deb06330a92b1/plugin-maven#how-can-i-enforce-formatting-gradually-aka-ratchet

  • gradle or maven version: Maven 3.6.0
  • spotless version: 2.0.1
  • operating system and version: Debian GNU+Linux 10.5
  • copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible (TBD)
  • copy-paste the full content of any console errors emitted by gradlew spotless[Apply/Check] --stacktrace (TBD)

I need to reproduce in a public repository. I'm not comfortable even sharing the error messages generated out of our propritary repository. So, the copy-paste requirements above are TBD.

I hope it won't take long to publicly reproduce.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions