From 4b3bc35bc81d92f8741e975b61e5443ba8f2d154 Mon Sep 17 00:00:00 2001 From: Devin Dooley Date: Fri, 13 Nov 2026 16:29:13 -0800 Subject: [PATCH 1/4] Add gitignore template linter Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/gitignore-formatting.yml | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/gitignore-formatting.yml diff --git a/.github/workflows/gitignore-formatting.yml b/.github/workflows/gitignore-formatting.yml new file mode 100644 index 00000000..aafecb02 --- /dev/null +++ b/.github/workflows/gitignore-formatting.yml @@ -0,0 +1,53 @@ +name: Gitignore formatting + +on: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + formatting: + name: Check gitignore formatting + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: Check out repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + with: + python-version: "3.15.2" + + - name: Install formatting tools + run: python -m pip install pre-commit-hooks==6.0.0 + + - name: Check all gitignore files recursively + shell: bash + run: | + git ls-files -z -- ':(top,glob)**/*.gitignore' > "$RUNNER_TEMP/gitignore-files" + mapfile -d '' -t files < "$RUNNER_TEMP/gitignore-files" + + if (( ${#files[@]} == 0 )); then + echo "::error::No gitignore files found." + exit 1 + fi + + echo "Checking ${#files[@]} gitignore files." + + status=0 + mixed-line-ending --fix=lf -- "${files[@]}" || status=1 + trailing-whitespace-fixer -- "${files[@]}" || status=1 + end-of-file-fixer -- "${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[@]}" + fi + + exit "$status" From 5686bb8cb6d53fa30a1092cb920c5b841424f93e Mon Sep 17 00:00:00 2001 From: Devin Dooley Date: Fri, 13 Nov 2026 16:36:46 -0800 Subject: [PATCH 2/4] 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" From 850bb5152cc16c4d0240807992a4cbfdc233caec Mon Sep 17 00:00:00 2001 From: Devin Dooley Date: Fri, 13 Nov 2026 16:38:24 -0800 Subject: [PATCH 3/4] Fix existing template formatting violations Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- R.gitignore | 2 +- TouchDesigner.gitignore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R.gitignore b/R.gitignore index dcfb5ebd..a71206e9 100644 --- a/R.gitignore +++ b/R.gitignore @@ -49,7 +49,7 @@ po/*~ # RStudio Connect folder rsconnect/ -# compiled code +# compiled code src/*.o src/*.so src/*.dll diff --git a/TouchDesigner.gitignore b/TouchDesigner.gitignore index c8b34bf2..6d1a7dba 100644 --- a/TouchDesigner.gitignore +++ b/TouchDesigner.gitignore @@ -19,4 +19,4 @@ # Python / build artifacts __pycache__/ *.pyc -*.pyo \ No newline at end of file +*.pyo From bebe9094f0a65b2e1119974eb55d8eb90895c359 Mon Sep 17 00:00:00 2001 From: Devin Dooley Date: Fri, 13 Nov 2026 16:40:41 -0800 Subject: [PATCH 4/4] Reduce dos2unix log noise while preserving failure diagnostics Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/gitignore-formatting.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gitignore-formatting.yml b/.github/workflows/gitignore-formatting.yml index a7d33532..3fcde2ea 100644 --- a/.github/workflows/gitignore-formatting.yml +++ b/.github/workflows/gitignore-formatting.yml @@ -46,7 +46,10 @@ jobs: echo "Checking ${#files[@]} gitignore files." status=0 - dos2unix --keep-bom -- "${files[@]}" || status=1 + if ! dos2unix --keep-bom -- "${files[@]}" > "$RUNNER_TEMP/dos2unix.log" 2>&1; then + cat "$RUNNER_TEMP/dos2unix.log" >&2 + status=1 + fi trailing-whitespace-fixer -- "${files[@]}" || status=1 end-of-file-fixer -- "${files[@]}" || status=1