Remove extra newlines from formatting which resulted in necessary double newlines#8247
Merged
iSazonov merged 1 commit intoPowerShell:masterfrom Nov 14, 2018
Merged
Conversation
ffbfe0a to
49f7c17
Compare
Collaborator
|
What we get with: dir | Format-Table -GroupBy Name |
Member
Author
(get-process pwsh | format-list | Out-String).Replace("`n","\n`n")Before: After: |
Member
Author
(dir | select -first 3 |Format-Table -GroupBy Name | out-string).replace("`n","\n`n")Before: After: |
Collaborator
|
Is it ok to have one '\n' before "Directory ..."? |
Member
Author
|
@iSazonov you are asking if it's ok to separate the groups with just a single newline vs two? Seems fine to me and just as readable visually. In the future, we should leverage vt100 as a way to provide visual indicators rather than rely on whitespace only. |
iSazonov
approved these changes
Nov 13, 2018
anmenaga
approved these changes
Nov 13, 2018
| Test-ValidateSet 'Hello' | Should -BeExactly 'Hello' | ||
| } finally { | ||
| Remove-Module -Name $moduleFile -Force | ||
| Remove-Module -Name $moduleFile -Force -ErrorAction SilentlyContinue |
There was a problem hiding this comment.
This is not related to this formatting code change, right?
Member
Author
There was a problem hiding this comment.
Correct. Was running the tests locally and this line was outputting unncessarily
Member
|
@iSazonov Reminder to add |
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.
PR Summary
When formatting, the
Groupstart and end added unnecessary newlines which resulted in double newlines in many cases. Formatting changes are not considered breaking.Before:
After:
There are still a few cases where the final output has two newlines (but not three anymore!). This is a bit more complicated to fix and would need to track state that either a newline was the last thing output or the item is the last in a collection and doesn't need a separator.
Fix #7186
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests