mirror of
				https://github.com/Ed94/format_style.git
				synced 2025-11-03 15:26:13 -08: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"
 |