Apply spotless after quick-check failures#3551
Conversation
| - name: suggester / spotless | ||
| uses: reviewdog/action-suggester@v1 | ||
| if: failure() | ||
| with: | ||
| tool_name: spotless |
There was a problem hiding this comment.
Neat tool! I'm assuming if the job fails for other reasons, and there is no diff, the tool won't suggest any changes?
There was a problem hiding this comment.
I mean it might? It depends on if the spotlessjavaapply actually made any changes...
There was a problem hiding this comment.
I imagine this must be the case - but I want to make sure that if there are no spotless changes, then the suggester doesn't make an "empty" suggestion or something like that.
| if: failure() | ||
| with: | ||
| job-id: spotless-formatting | ||
| arguments: spotlessJavaApply |
There was a problem hiding this comment.
Any reason to prefer spotlessJavaApply instead of spotlessApply?
There was a problem hiding this comment.
Ah good call, that's better. I'm also adding updateProto to this as a separate step, so the changes are marked separately.
mofojed
left a comment
There was a problem hiding this comment.
Any reason not to merge this?
Side note - I prefer to format on save, any reason we don't on Community?
@mofojed what do you mean "format on save"? |
|
IntelliJ can format on save, but its formatting tools don't quite agree with spotless, so you end up going back and forth if you dont have it perfectly configured. I'm holding off trying to get the proto stuff right too, but I can probably back that out and just merge as is. |
Automatically applies spotless after a quick check fails, and presents the diff as github PR comment suggestions for the author to fix.
Example pull request showing this in action (with the suggestion manually "unresolved" so that it is visible when looking at the changes): niloc132#4