Better verbose output for clang-format (#5306)
This commit is contained in:
@@ -41,8 +41,9 @@ $files = Get-ChildItem -Path $basePath\soh -Recurse -File `
|
|||||||
(-not ($_.FullName -like "*\soh\src\*" -or $_.FullName -like "*\soh\include\*")))) -and `
|
(-not ($_.FullName -like "*\soh\src\*" -or $_.FullName -like "*\soh\include\*")))) -and `
|
||||||
(-not ($_.FullName -like "*\soh\assets\*")) }
|
(-not ($_.FullName -like "*\soh\assets\*")) }
|
||||||
|
|
||||||
foreach ($file in $files) {
|
for ($i = 0; $i -lt $files.Length; $i++) {
|
||||||
|
$file = $files[$i]
|
||||||
$relativePath = $file.FullName.Substring($basePath.Length + 1)
|
$relativePath = $file.FullName.Substring($basePath.Length + 1)
|
||||||
Write-Host "Formatting $relativePath"
|
Write-Host "Formatting [$($i+1)/$($files.Length)] $relativePath"
|
||||||
.\clang-format.exe -i $file.FullName
|
.\clang-format.exe -i $file.FullName
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,9 @@
|
|||||||
# -print0
|
# -print0
|
||||||
# separate paths with NUL bytes, avoiding issues with spaces in paths
|
# separate paths with NUL bytes, avoiding issues with spaces in paths
|
||||||
#
|
#
|
||||||
# | xargs -0 clang-format-14 -i
|
# | xargs -0 clang-format-14 -i -verbose
|
||||||
# use xargs to take each path we've found
|
# use xargs to take each path we've found
|
||||||
# and pass it as an argument to clang-format
|
# and pass it as an argument to clang-format
|
||||||
|
# verbose to print files being formatted and X out of Y status
|
||||||
|
|
||||||
find soh -type f \( -name "*.c" -o -name "*.cpp" -o \( -name "*.h" ! -path "soh/src/**.h" ! -path "soh/include/**.h" \) \) ! -path "soh/assets/*" -print0 | xargs -0 clang-format-14 -i
|
find soh -type f \( -name "*.c" -o -name "*.cpp" -o \( -name "*.h" ! -path "soh/src/**.h" ! -path "soh/include/**.h" \) \) ! -path "soh/assets/*" -print0 | xargs -0 clang-format-14 -i --verbose
|
||||||
|
|||||||
Reference in New Issue
Block a user