浏览代码

Print colored diffs when there are formatting failures in CI

This makes diffs more readable in CI logs.

(cherry picked from commit 38424714b1d3c7e35fb0cb2de548338885a98c14)
Hugo Locurcio 4 年之前
父节点
当前提交
d1a4cb2bea
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      misc/scripts/black_format.sh
  2. 1 1
      misc/scripts/clang_format.sh
  3. 1 1
      misc/scripts/file_format.sh

+ 1 - 1
misc/scripts/black_format.sh

@@ -15,7 +15,7 @@ PY_FILES=$(find \( -path "./.git" \
                 \) -print)
                 \) -print)
 black -l 120 $PY_FILES
 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 no patch has been generated all is OK, clean up, and exit.
 if [ ! -s patch.patch ] ; then
 if [ ! -s patch.patch ] ; then

+ 1 - 1
misc/scripts/clang_format.sh

@@ -40,7 +40,7 @@ while IFS= read -rd '' f; do
     done
     done
 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 no patch has been generated all is OK, clean up, and exit.
 if [ ! -s patch.patch ] ; then
 if [ ! -s patch.patch ] ; then

+ 1 - 1
misc/scripts/file_format.sh

@@ -44,7 +44,7 @@ while IFS= read -rd '' f; do
     perl -i -pe 's/\x20== true//g' "$f"
     perl -i -pe 's/\x20== true//g' "$f"
 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 no patch has been generated all is OK, clean up, and exit.
 if [ ! -s patch.patch ] ; then
 if [ ! -s patch.patch ] ; then