Skip to content

Commit

Permalink
Print colored diffs when there are formatting failures in CI
Browse files Browse the repository at this point in the history
This makes diffs more readable in CI logs.

(cherry picked from commit 3842471)
  • Loading branch information
Calinou authored and sairam4123 committed Nov 10, 2021
1 parent aa181cf commit 685fc53
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion misc/scripts/black_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PY_FILES=$(find \( -path "./.git" \
\) -print)
black -l 120 $PY_FILES

git diff > patch.patch
git diff --color > patch.patch

# If no patch has been generated all is OK, clean up, and exit.
if [ ! -s patch.patch ] ; then
Expand Down
2 changes: 1 addition & 1 deletion misc/scripts/clang_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ while IFS= read -rd '' f; do
done
done

git diff > patch.patch
git diff --color > patch.patch

# If no patch has been generated all is OK, clean up, and exit.
if [ ! -s patch.patch ] ; then
Expand Down
2 changes: 1 addition & 1 deletion misc/scripts/file_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ while IFS= read -rd '' f; do
perl -i -pe 's/\x20== true//g' "$f"
done

git diff > patch.patch
git diff --color > patch.patch

# If no patch has been generated all is OK, clean up, and exit.
if [ ! -s patch.patch ] ; then
Expand Down

0 comments on commit 685fc53

Please sign in to comment.