Skip to content

Commit 8fff44e

Browse files
authored
Add git diff to lint messaging so it is more actionable (#4041)
1 parent 5ac95b2 commit 8fff44e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.circleci/config.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ run_clang_format: &run_clang_format
182182
find -name '*.cpp' -o -name '*.h' | xargs clang-format-7 -i -style=file
183183
git_status=$(git status --porcelain)
184184
if [[ $git_status ]]; then
185-
echo "clang-format-7 is not happy, please run \"clang-format-7 -i -style /PATH/TO/foo.cpp\" to the following files"
185+
git diff
186+
echo "clang-format-7 recommends the changes above, please manually apply them OR automatically apply the changes "
187+
echo "by running \"clang-format-7 -i -style /PATH/TO/foo.cpp\" to the following files"
186188
echo "${git_status}"
187189
exit 1
188190
else
@@ -207,7 +209,9 @@ run_yapf: &run_yapf
207209
yapf -i -r *.py test/ scripts/ torch_xla/
208210
git_status=$(git status --porcelain)
209211
if [[ $git_status ]]; then
210-
echo "yapf is not happy, please run `yapf -i /PATH/TO/foo.py` to the following files"
212+
git diff
213+
echo "yapf recommends the changes above, please manually apply them OR automatically apply the changes "
214+
echo "by running `yapf -i /PATH/TO/foo.py` to the following files"
211215
echo "${git_status}"
212216
exit 1
213217
else

0 commit comments

Comments
 (0)