Skip to content
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

Support ktfmt dropbox style in maven plugin #764

Merged
merged 8 commits into from
Jan 3, 2021
Merged

Support ktfmt dropbox style in maven plugin #764

merged 8 commits into from
Jan 3, 2021

Conversation

theminecoder
Copy link
Contributor

This option exists in the Gradle plugin but currently does not in the maven plugin. This exposes it in a similar way to how the Gradle plugin does.

@nedtwigg
Copy link
Member

Thanks! The GoogleJavaFormat maven step handles this situation like this:

The gradle plugin for GJF handles it like this:

public void style(String style) {
this.style = Objects.requireNonNull(style);
replaceStep(createStep());
}
public void aosp() {
style("AOSP");
}

And the gradle plugin for ktfmt handles it like this:

public void dropboxStyle() {
style = Style.DROPBOX;
replaceStep(createStep());
}

Based on these precedents, what do you think about switching to a String style?

@theminecoder
Copy link
Contributor Author

The problem is that the ktfmt step expects an enum value rather then a string so we will need to convert and validate the options users can provide.

Also I was trying to keep to exposure of this option the same as gradle so if I was to make this into a string I would probably end up updating gradle to take a string (and run it through the validation)

So if you are happy for me to do that I can :)

@nedtwigg nedtwigg merged commit 49af781 into diffplug:main Jan 3, 2021
@nedtwigg
Copy link
Member

nedtwigg commented Jan 4, 2021

Shipped in plugin-maven 2.7.0.

@theminecoder theminecoder deleted the patch-1 branch January 6, 2021 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants