-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add ActionOnSave #33
base: main
Are you sure you want to change the base?
Add ActionOnSave #33
Conversation
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.
Great work @oraum, thanks so much for the PR! I have a couple of nit-pick comments, and also we will need to bump the plugin version in this PR as well.
The main blocker for this is that during manual testing I found it doesn't handle processing multiple files on save. It only formats the first file that is open, but errors out on the second.
See this for repro steps.
I haven't had the chance to dig into this too much, but made a post here so hopefully we'll get an answer there on how to resolve this.
src/main/java/com/github/ragurney/spotless/actions/SpotlessActionOnSave.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/ragurney/spotless/actions/SpotlessActionOnSave.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/ragurney/spotless/config/SpotlessConfiguration.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/ragurney/spotless/config/SpotlessConfiguration.java
Outdated
Show resolved
Hide resolved
src/main/java/com/github/ragurney/spotless/config/SpotlessConfiguration.java
Outdated
Show resolved
Hide resolved
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.
Changes look good @oraum, thanks a lot!
I think the only blocker at this point is the resolution to the issue I mentioned with saving multiple files in this comment.
I've asked IntelliJ what the proper fix for this is here, and hopefully we'll get an answer soon! It looks like they're saying to use the external formatter hook, but that would be a completely separate project as far as I understand it.
I think this is blocked until either diffplug/spotless#791 is implemented and merged or we change this PR to only support format on save for the current file only due to the lack of gradle support to run multiple builds in parallel. |
Hey guys, thanks for the work so far :) What is the status of this PR, looks "abandoned"? |
Hey. Could we just re-label this PR and run spotless for the currently opened file? This would already solve a lot. |
Any updates on this? |
Heavily inspired by Jetbrains prettierJS plugin
resolves #8