Ned Twigg
Ned Twigg
It works in CI, but it doesn't work on a bare or `--depth=1` checkout. Most CI systems (for sure GitHub and GitLab) allow for full checkout, so that's the workaround....
> is implemented by-default into a majority of CI tools. I agree, but I still think it would still be nice if Spotless fixed it automatically. If the branch that...
Spotless is looking for the merge base. So it needs the history of `ratchetFrom`, and it also needs the history of `HEAD`, at least deep enough to find the intersection...
Using command-line git is an option too. We use it here https://github.com/diffplug/spotless/blob/d9474fbffb03cfa1f54c55b8c3beebe81cd7611a/lib/src/main/java/com/diffplug/spotless/generic/LicenseHeaderStep.java#L289 If you go this route, I would use [`ProcessRunner`](https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/ProcessRunner.java) to handle the shell output. Someday we should refactor...
I would use [environment variables](https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables) and do something like: ```gradle String ratchetAnchor = if (System.getenv('CI') == 'true') 'origin/main' else 'upstream/main' spotless { ratchetFrom ratchetAnchor ```
JGit [6.3 added support for manipulating shallow clones](https://wiki.eclipse.org/JGit/New_and_Noteworthy/6.3). We would need to bump our minimum JRE to 11 to use JGit 6.3, but I'd be happy to do that if...
I would expect that the scala version wouldn't depend on `-PscalaVersion`, and here is why: https://github.com/diffplug/spotless/blob/ce98b688cb4724a95e0abb05f4bbaf398097c1b8/lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java#L83 The scalaFmt classpath is resolved in an isolated way, as shown above. The `provisioner`...
A few things - for one thing, if we wanted to remove the reflection, that is possible - https://github.com/diffplug/spotless/issues/524 Also we are using an isolated classloader. We grab the jar...
Add `-x signPluginMavenPublication` to the gradle command line.
Thanks to @mdedetrich for the new `majorScalaVersion` parameter, published in `plugin-gradle 6.10.0` and `plugin-maven 2.25.0`.