-
Notifications
You must be signed in to change notification settings - Fork 463
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
maven IDE hook for jj fix
#2424
Comments
Spotless Gradle supports this, but the Maven support is immature. @SapiensAnatis has made some progress here. |
jj fix
I didn’t write the IDE hook to be clear, but it sounds broadly like what you are looking for. If you use these arguments: https://github.com/SapiensAnatis/vscode-spotless-maven/blob/5cb5fa5a1cc444e47aa50e33547b2ffefdf56dec/src/maven/basicMavenExecutor.ts#L28 You will get a process that takes a document on stdin and then returns on stderr IS CLEAN / IS DIRTY and on stdout the formatted document. The only problem is I can’t remember if you get the formatted document on stdout if Spotless returns IS CLEAN. In the vscode extension we just return ‘no changes’ if we get that back. |
Hey @SapiensAnatis @nedtwigg thank you for the feedback, I will do a bit of experimentation with that to see how it behaves and come back here to share my findings! |
I can already share this:
|
Performance wise I think the way forward is to use mvnd which runs as a daemon and is much faster for ad-hoc formatting. However it doesn’t seem to be compatible with the IDE hook at the minute, I’ve raised a few issues over there so hopefully those will be fixed soon! |
I did a few tests with It's taking something like 2.8sec with running |
Oh the IDE hook is really only for a single file (hence IDE). On a single file it takes about 0.4s for me (assuming the daemon is warm) but if you are formatting your entire solution it will probably be slower. |
Hi,
I am trying to setup jujutsu so that it runs spotless (configured using the maven plugin in my repository) when using
jj fix
, see https://jj-vcs.github.io/jj/latest/cli-reference/#jj-fix.The problem is that the requirement from jujutsu is that the tool that does formatting should respect the following rule:
Would that be something that could be added to spotless?
Thanks!
The text was updated successfully, but these errors were encountered: