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:" 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)