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

PalantirJavaFormat in plugin-maven should take style parameter #1694

Merged
merged 3 commits into from
May 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ public class PalantirJavaFormat implements FormatterStepFactory {
@Parameter
private String version;

@Parameter
private String style;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid parameter will failed on PalantirJavaFormatFormatterFunc.<init> calls JavaFormatterOptions.Style.valueOf(style).


@Override
public FormatterStep newFormatterStep(FormatterStepConfig config) {
String version = this.version != null ? this.version : PalantirJavaFormatStep.defaultVersion();
return PalantirJavaFormatStep.create(version, config.getProvisioner());
String style = this.style != null ? this.style : PalantirJavaFormatStep.defaultStyle();
return PalantirJavaFormatStep.create(version, style, config.getProvisioner());
}
}