Removing trailing whitespace #2725
Closed
powercode wants to merge 1 commit intoPowerShell:masterfrom
Closed
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
Collaborator
|
Can you, please, resolve the conflicts? |
cb155ef to
5054a40
Compare
Collaborator
|
@powercode sorry there are conflicts again :( |
6e7233d to
a931612
Compare
Collaborator
Author
|
Just pushed a resolved version |
Collaborator
Author
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
Contributor
|
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. |
Contributor
|
Closing this in favor of #3001. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trailing whitespace removed from cs,json,xml,xaml,ps1,psm1,ps1xml, psd1 files.
The followning command was used: