-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ratchetFrom
to maven
#603
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jun 5, 2020
Closed
I'm working on this now. |
lutovich
approved these changes
Jun 28, 2020
plugin-maven/src/main/java/com/diffplug/spotless/maven/GitRatchetMaven.java
Outdated
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
HELP WANTED. This unfinished PR implementsratchetFrom 'origin/master'
, which is currently only available in plugin-gradle. I am not a maven user, finishing this PR is not going to make the top of my todo list. However, I have outlined the work necessary to complete this PR, so that any interested party can take it to the finish line.Basic implementation
In order to integrate it into maven, we need to take these two places in the maven plugin:
spotless/plugin-maven/src/main/java/com/diffplug/spotless/maven/SpotlessCheckMojo.java
Lines 52 to 55 in e374870
spotless/plugin-maven/src/main/java/com/diffplug/spotless/maven/SpotlessApplyMojo.java
Lines 46 to 49 in e374870
and make it look like this place in the gradle plugin (broader context in #590).
spotless/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessTask.java
Lines 125 to 130 in e374870
We'll also need a test, this one from gradle gets the job done pretty well:
spotless/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/RatchetFromTest.java
Lines 37 to 108 in e374870
Integration with license
Once that is done, there's a mildly tricky bit where you really want the license step's behavior to depend on whether
ratchetFrom
is enabled. Here is how it is documented in gradle, and here is how it is implemented:spotless/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/FormatExtension.java
Lines 464 to 468 in e374870