Display diff on `git cl format --diff` when formatting Java files.
Google Java Format does not support `--diff` parameter, but we can simulate it by manually diffing the output of the tool with the current file on disk. All git cl-triggered format tools should support --diff output, because there're situations where a change in a file might be required, but it's unclear what exactly should be changed, because a developer might not have access to the host OS which only runs the check. We at Brave want to run `git cl format --diff` as a part of CI run when a format check fails. Change-Id: I2feee60219a54ad44b93bc10f5488a9c05715a4a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5351216 Reviewed-by: Andrew Grieve <agrieve@chromium.org> Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Aleksey Khoroshilov <akhoroshilov@brave.com>changes/16/5351216/4
parent
3c79cfc485
commit
78bef266ac
Loading…
Reference in New Issue