-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Enforce ScalaFmt/PalantirJavaFormat/KtLint on example doc/test suites (500USD Bounty) #3829
Comments
Hello interesting but I think this might not be beginner friendly for someone new to the project.Will be on the lookout for other issues. |
In this context, what does "Automate enforcement and compliance" look like?
|
Just this, with some manual command that can be run to fix them locally. Same as the current workflow. |
I'm going to see if I can figure this one out tomorrow |
@myyk some pointers if you're going to look into this:
|
Thanks! I was trying to piece together 2, that helps a lot. That all makes sense. |
This comment was marked as outdated.
This comment was marked as outdated.
Partially completes: #3829 Tested locally by breaking format of `example/scalalib/basic/1-simple/foo/src/Foo.scala` by just adding a bunch of spaces. * Observe break with `./mill mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources` failure. * Observe fix with `./mill mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources` Used `// format: off` rather than changing [docstrings.style = keep](https://scalameta.org/scalafmt/docs/configuration.html#docstringsstyle--keep) to our `.scalafmt.conf` since that would affect all files. There doesn't seem to be a built in way in ScalaFmt to have folder level configs or something like this. I thought it might be better to not have `example` be an exception cases if we can avoid it. I'm not sure if the `// format: off` comments break something else though.
* [x] Need to merge #3903 first because it's built directly on top of it to reduce conflicts. Change 2/3 for #3829 * I updated the `PalantirFormatModule.scala` so that it didn't create a ton of noise when there's actually no issues such as no java code changing. I think this is a good thing to do, but I'm not 100% since some users might feel this change in some way. * Bugfix: The Github Action now fails on any error instead of only `./mill -i __.fix --check` (was using `;` instead of `&&`) * Added Palantir formatting into the Github Action * Removed a lot of cruft so that the example java modules could use the `PalantirFormatModule`. --------- Co-authored-by: Li Haoyi <[email protected]>
From the maintainer Li Haoyi: I'm putting a 500USD bounty on this issue, payable by bank transfer on a merged PR implementing this.
Currently managing the formatting for this is manual, and sometimes inconsistencies slip through. We should really just automate enforcement and compliance.
We should as much as possible re-use the infrastructure Mill has already built around these autoformatters, to dogfood it. This would mean doing the autoformatting as part of Mill's own Mill build, using the various
ScalaFmtModule
/PalantirJavaFormatModule
/KtLintModule
s as necessaryThe text was updated successfully, but these errors were encountered: