-
Notifications
You must be signed in to change notification settings - Fork 24
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
This action logs the contents of every scanned Java file #25
Comments
Hello @damien-swarm, This action is a wrapper around The behavior you describe is controlled by the executable, not by this action. You can replicate it by downloading the program on your computer and running it on the command line. If we look at the code of
Note that files already formatted properly are not printed. So, to solve your issue, you could either:
|
Here's an example showing how you can print the diff of every file modified by the action (I also added it in the README): name: Format
on: [ push, pull_request ]
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # v2 minimum required
- uses: axel-op/googlejavaformat-action@v3
with:
args: "--replace"
skip-commit: true
- name: Print diffs
# "--exit-code" will make this command exit with code 1 if there is a diff
run: git --no-pager diff --exit-code |
I hope I'm just using this plugin wrong, but when I tried using it with
--set-exit-if-changed
:it logs the contents of every single scanned Java file to the Github actions logs (tens of thousands of lines). This is not useful and makes it harder to find actual errors. In fact, in my most recent run, I got
Error: Google Java Format failed with exit code 1
without any "Actual vs Expected" errors :(The text was updated successfully, but these errors were encountered: