style: remove trailing whitespace and improve whitespace handling - #182
Conversation
| # This addresses the PSAvoidTrailingWhitespace rule in PSScriptAnalyzer | ||
|
|
||
| Write-Host "Removing trailing whitespace from files..." -ForegroundColor Green | ||
| Write-Host "Removing trailing whitespace and trailing empty lines from files..." -ForegroundColor Green |
Check warning
Code scanning / PSScriptAnalyzer
File 'remove-trailing-whitespace.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| } | ||
|
|
||
| Write-Host "Done! Fixed trailing whitespace in $count files." -ForegroundColor Green | ||
| Write-Host "Done! Fixed trailing whitespace and empty lines in $count files." -ForegroundColor Green |
Check warning
Code scanning / PSScriptAnalyzer
File 'remove-trailing-whitespace.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
Improves code formatting by removing unnecessary whitespace and trailing empty lines across multiple scripts. This enhances code readability and consistency.
Commits included:
remove unnecessary whitespace in multiple scripts
improve whitespace removal script to remove tail empty lines
remove trailing whitespace from multiple scripts