mirror of
https://github.com/Ed94/format_style.git
synced 2024-09-20 04:37:33 -07:00
18 lines
525 B
PowerShell
18 lines
525 B
PowerShell
[string[]] $include = '*.h', '*.hh', '*.hpp', '*.c', '*.cc', '*.cpp'
|
|
[string[]] $exclude = ''
|
|
|
|
Write-Host "Beginning format...`n"
|
|
|
|
# Format the files.
|
|
$formatParams = @(
|
|
'-i' # In-place
|
|
'-style=file' # Search for a .clang-format file in the parent directory of the source file.
|
|
'-verbose'
|
|
)
|
|
|
|
$targetFiles = @(Get-ChildItem -Recurse -Path $path_test -Include $include -Exclude $exclude | Select-Object -ExpandProperty FullName)
|
|
|
|
clang-format $formatParams $targetFiles
|
|
|
|
Write-Host "`nFormatting complete"
|