-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Removing trailing whitespace #2725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @powercode, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
df59dd4 to
cb155ef
Compare
|
Can you, please, resolve the conflicts? |
cb155ef to
5054a40
Compare
|
@powercode sorry there are conflicts again :( |
6e7233d to
a931612
Compare
|
Just pushed a resolved version |
Don't think I'm responsible for that. |
36fdb8c to
48627ce
Compare
…sd1 files
The followning command was used:
```
using namespace System.Text.RegularExpressions
function Remove-TrailingWhitespace {
param(
[Parameter(Mandatory, ValueFromPipelineByPropertyName, ValueFromPipeline)]
[Alias('PSPath')]
[string] $LiteralPath
)
begin {
$trailingWhiteSpace = [Regex]::new('(?m)[ \t]+\r?$', [RegexOptions]::Compiled)
}
process {
try {
$LiteralPath = (Resolve-Path $LiteralPath).ProviderPath
if (Test-path -PathType Leaf $LiteralPath) {
$content = Get-Content -Raw -LiteralPath $LiteralPath
if ($null -ne $content) {
$trimmedContent = $trailingWhiteSpace.Replace($content, "`r")
if ($trimmedContent -ne $content) {
# Set-Content fails for some reason with 'Set-Content : Stream was not readable.'
[io.file]::WriteAllText($LiteralPath, $trimmedContent, [Text.Encoding]::ASCII)
Get-Item $LiteralPath
}
}
}
}
catch {
Write-Error -Message $_.Exception.Message -TargetObject $LiteralPath
}
}
}
```
48627ce to
eb9cb54
Compare
|
There are way too many changes to review and I'm concerned about the potential for problems due to changing the file encoding. For example, if we test data that used a specific encoding, we would lose the coverage due to a PR like this. |
|
Closing this in favor of #3001. |
Trailing whitespace removed from cs,json,xml,xaml,ps1,psm1,ps1xml, psd1 files.
The followning command was used: