From f4489a44f5df34f7832fcd7b1b88ba7d73201c9f Mon Sep 17 00:00:00 2001 From: easy Date: Tue, 28 Jul 2020 19:19:36 +1000 Subject: [PATCH 1/2] Fix format on CI. "git add" makes "git ls-files -m" output always empty. --- ci/do_ci.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index b6d23f763f..b394de03c8 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -107,8 +107,6 @@ elif [[ "$1" == "benchmark" ]]; then exit 0 elif [[ "$1" == "format" ]]; then tools/format.sh - # normalize file endings according to .gitattributes - git add --renormalize . CHANGED="$(git ls-files --modified)" if [[ ! -z "$CHANGED" ]]; then echo "The following files have changes:" From 3c2438fa43311bb1f277d4220ae8204624956086 Mon Sep 17 00:00:00 2001 From: easy Date: Tue, 28 Jul 2020 19:21:53 +1000 Subject: [PATCH 2/2] Exclude CRLF files when changing line endings. --- tools/format.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/format.sh b/tools/format.sh index 1b150dbca3..7d5249d5e3 100755 --- a/tools/format.sh +++ b/tools/format.sh @@ -16,8 +16,9 @@ fi # Correct common miscapitalizations. "${SED[@]}" 's/Open[t]elemetry/OpenTelemetry/g' $($FIND -type f -print) -# No CRLF line endings. -"${SED[@]}" 's/\r$//' $($FIND -type f -print) +# No CRLF line endings, except Windows files. +"${SED[@]}" 's/\r$//' $($FIND -name '*.ps1' -prune -o \ + -name '*.cmd' -prune -o -type f -print) # No trailing spaces. "${SED[@]}" 's/ \+$//' $($FIND -type f -print)