-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Added plugin for formatting Java sources using Palantir #3531
Conversation
@lihaoyi |
Looks good overall, just need a few tweaks. Need a short |
# Conflicts: # contrib/package.mill
@lihaoyi Please review.
|
|
||
> ./mill javafmt # alternatively, format all Java source files | ||
|
||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also show off the ./mill mill.contrib.palantirjavaformat.PalantirJavaFormat/
workflow, and after formatting is run we should run check
again and ensure it does not error like it did before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Please review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to remove check
examples.
Incomplete argument --check <bool> is missing a corresponding value
Expected Signature: palantirformat
--check <bool>
sources <str>...
,)
contrib/palantirjavaformat/src/mill/contrib/palantirjavaformat/PalantirJavaFormatModule.scala
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,187 @@ | |||
package mill | |||
package contrib.palantirjavaformat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I edited a comment earlier to say this, but let's standardize the naming convention of palantirformat
/PalantirFormat
. I know it doesn't quite match the palantir-java-format
project name, but using the full name over and over is getting verbose enough I think we should shorten it here just for ease of use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lihaoyi
How about palantirjavafmt
? Get a lot more clarity with the addition of a single character.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with palantirformat
, googling palantir format
brings up only this one project, so there shouldn't be any ambiguity for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One consideration is that I may want to move this directly into javalib
, just like how ScalaFmtModule
is in scalalib
and KLintModule
is in kotlinlib
. That way it'll be mill.javalib.palantirformat
which should be unambiguous enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would the documentation go in this case? docs/modules/ROOT/pages/Java_Module_Config.adoc
?
contrib/palantirjavaformat/src/mill/contrib/palantirjavaformat/PalantirJavaFormatModule.scala
Outdated
Show resolved
Hide resolved
Left some comments The tests are failing because we need to wire up Line 727 in 2dc343f
|
I think this looks great, two small nits in the example and I think we can merge this and close out the bounty |
Thanks @ajaychandran! will transfer the bounty using the same details as earlier |
Fixes #3612. This PR is based on the logic done in #3531, so it looks quite similar. Co-authored-by: 0xnm <[email protected]>
Added
contrib.palantir.JavafmtModule
for formatting Java sources using Palantir.The plugin also supports command line arguments for
--check
flagResolves #3448.