From b9d4b54c5d5081a83ddaca432121e458149f34fe Mon Sep 17 00:00:00 2001 From: jpirnay Date: Sat, 4 Apr 2026 17:36:47 +0200 Subject: [PATCH] Include .c files too --- bin/clang-format-fix.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/clang-format-fix.ps1 b/bin/clang-format-fix.ps1 index f90a81b7..f5d73d1c 100644 --- a/bin/clang-format-fix.ps1 +++ b/bin/clang-format-fix.ps1 @@ -109,16 +109,16 @@ function Test-Excluded($fullPath) { } if ($g) { - # Only git-modified *.cpp / *.h files + # Only git-modified *.cpp / *.c / *.h files # Covers both staged and unstaged changes $files = @(git -C $repoRoot diff --name-only HEAD) + @(git -C $repoRoot diff --name-only --cached) | Sort-Object -Unique | - Where-Object { $_ -match '\.(cpp|h)$' } | + Where-Object { $_ -match '\.(cpp|c|h)$' } | ForEach-Object { Get-Item (Join-Path $repoRoot $_) -ErrorAction SilentlyContinue } | Where-Object { $_ -and -not (Test-Excluded $_.FullName) } } else { - $files = Get-ChildItem -Path $repoRoot -Recurse -Include *.cpp, *.h -File | + $files = Get-ChildItem -Path $repoRoot -Recurse -Include *.cpp, *.c, *.h -File | Where-Object { -not (Test-Excluded $_.FullName) } }