Skip to content

Conversation

regadas
Copy link
Contributor

@regadas regadas commented Mar 2, 2020

Users could disable AutomateJavaFormatterPlugin however i think it's not very intuitive; lmtk what do you think about adding this setting.

With this setting we have some parity with scalafmtOnCompile

@ennru
Copy link
Contributor

ennru commented Mar 2, 2020

Did you notice the discussion in #68?

@mkurz
Copy link
Member

mkurz commented Mar 2, 2020

I am totally OK using this pull request instead of mine (#68).
However I think it is still a good idea to disable javafmtOnCompile by default. First to keep it aligned with scalafmt, which also disables format on compile by default, second I think it may be too intrusive: E.g. if you add the plugin to a project and have uncommitted changes in java files, the formatter kicks in and re-formats everything, and suddenly you end up not knowing what were the changes you did and what are the changes javafmt did. That happend to me once.
BTW: I did not review the pull request.

@regadas
Copy link
Contributor Author

regadas commented Mar 2, 2020

Apologies! I did miss #68 There were a lot of open PR and I didn't see this one in the middle of them.

Yeah I also agree that formatting on compile should be disabled by default; I only kept it as is right now to make the transition smooth for the javafmtOnCompile setting. My plan was: release a new version with this now and in the next version break the current behaviour. We can however do it in one blow ¯_(ツ)_/¯ . lmwt.

@ennru ennru changed the title Add javafmOnCompile setting Add javafmtOnCompile setting Mar 2, 2020
@ennru
Copy link
Contributor

ennru commented Mar 2, 2020

Yes, I like the two-step idea. I'll review this and release 0.5.1 after merging.

Copy link
Contributor

@ennru ennru left a comment

Choose a reason for hiding this comment

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

LGTM.

@ennru ennru merged commit 23c4559 into sbt:master Mar 3, 2020
@mkurz
Copy link
Member

mkurz commented Mar 4, 2020

@ennru Any ETA for 0.5.1?

@regadas regadas deleted the feature/add-on-compile-setting branch April 21, 2020 01:11
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.

3 participants