From 5686bb8cb6d53fa30a1092cb920c5b841424f93e Mon Sep 17 00:00:00 2001 From: Devin Dooley Date: Fri, 13 Nov 2026 16:36:46 -0800 Subject: [PATCH] Preserve literal carriage returns with dos2unix Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/gitignore-formatting.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gitignore-formatting.yml b/.github/workflows/gitignore-formatting.yml index aafecb02..a7d33532 100644 --- a/.github/workflows/gitignore-formatting.yml +++ b/.github/workflows/gitignore-formatting.yml @@ -27,6 +27,11 @@ jobs: - name: Install formatting tools run: python -m pip install pre-commit-hooks==6.0.0 + - name: Install dos2unix + run: | + sudo apt-get update + sudo apt-get install --yes dos2unix + - name: Check all gitignore files recursively shell: bash run: | @@ -41,13 +46,14 @@ jobs: echo "Checking ${#files[@]} gitignore files." status=0 - mixed-line-ending --fix=lf -- "${files[@]}" || status=1 + dos2unix --keep-bom -- "${files[@]}" || status=1 trailing-whitespace-fixer -- "${files[@]}" || status=1 end-of-file-fixer -- "${files[@]}" || status=1 + git --no-pager diff --no-ext-diff --exit-code -- "${files[@]}" || status=1 + if (( status != 0 )); then - echo "::error::Formatting checks failed. See tool output and diff below." - git --no-pager diff --no-ext-diff -- "${files[@]}" + echo "::error::Formatting checks failed. See tool output and diff above." fi exit "$status"