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 Palantir-Java-Format for Java (500USD Bounty) #3448

Open
lihaoyi opened this issue Sep 3, 2024 · 5 comments · May be fixed by #3531
Open

Support Palantir-Java-Format for Java (500USD Bounty) #3448

lihaoyi opened this issue Sep 3, 2024 · 5 comments · May be fixed by #3531
Labels

Comments

@lihaoyi
Copy link
Member

lihaoyi commented Sep 3, 2024


From the maintainer Li Haoyi: I'm putting a 500USD bounty on this issue, payable by bank transfer on a merged PR implementing this.


Palantir-Java-Format is a common Java autoformatter, and we should support it as a contrib/ module to better support Java projects. We should support all common configuration options to allow usage on JavaModules and ScalaModules (which can contain Java sources). It should broadly work the same way ScalaFmt works for Scala (https://mill-build.org/mill/0.11.12/Scala_Module_Config.html#_reformatting_your_code) This needs to come with a reasonable set of unit tests, docs, and at least one example test that can be included in the documentation.

May be able to adapt something from https://github.com/sbt/sbt-java-formatter

@lefou
Copy link
Member

lefou commented Sep 3, 2024

I'd prefer palantir, either directly or via spotless, which could provide a lot of other formatters too.

@lihaoyi
Copy link
Member Author

lihaoyi commented Sep 3, 2024

Sure! Maybe it should be via spotless then?

@lihaoyi lihaoyi changed the title Support Google-Java-Format (500USD Bounty) Support Spotless Formatter for Java (500USD Bounty) Sep 3, 2024
@lihaoyi lihaoyi changed the title Support Spotless Formatter for Java (500USD Bounty) Support Palantir-Java-Format for Java (500USD Bounty) Sep 3, 2024
@lefou lefou added the bounty label Sep 3, 2024
@lihaoyi
Copy link
Member Author

lihaoyi commented Sep 3, 2024

Let's go with palantir-java-format for now. At a glance Spotless seems a lot more heavyweight, and maybe can come in a follow up, but palantir-java-format should suit the immediate need of "we need a java formatter" and hopefully be easier to implement

@lefou
Copy link
Member

lefou commented Sep 3, 2024

I experiemented with it in the past but got some class access issues due to not using the module classloader. So, if you're a Scala dev not so deep into Java, expect some difficulties.

@lihaoyi
Copy link
Member Author

lihaoyi commented Sep 3, 2024

yeah I assume there'll be stumbling blocks but I assume they'll be work-around-able. If it can work in eclipse/intellij/gradle/spotless it should be doable inside Mill; worst come to worst we can run it in a separate subprocess. But that's for whoever picks up the bounty to figure out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants