-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Remove extra newlines from formatting which resulted in necessary double newlines #8247
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
ffbfe0a
to
49f7c17
Compare
What we get with: dir | Format-Table -GroupBy Name |
(get-process pwsh | format-list | Out-String).Replace("`n","\n`n") Before:
After:
|
(dir | select -first 3 |Format-Table -GroupBy Name | out-string).replace("`n","\n`n") Before:
After:
|
Is it ok to have one '\n' before "Directory ..."? |
@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. |
@@ -401,7 +401,7 @@ Describe 'ValidateSet support a dynamically generated set' -Tag "CI" { | |||
Import-Module -Name $moduleFile -Force | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not related to this formatting code change, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. Was running the tests locally and this line was outputting unncessarily
@iSazonov Reminder to add |
PR Summary
When formatting, the
Group
start 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
,.ps1
and.psm1
files 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