Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upRemove extra newlines from formatting which resulted in necessary double newlines #8247
Conversation
SteveL-MSFT
assigned
iSazonov
Nov 13, 2018
SteveL-MSFT
requested review from
anmenaga and
iSazonov
Nov 13, 2018
SteveL-MSFT
force-pushed the
SteveL-MSFT:format-whitespace
branch
to
49f7c17
Nov 13, 2018
This comment has been minimized.
This comment has been minimized.
|
What we get with: dir | Format-Table -GroupBy Name |
This comment has been minimized.
This comment has been minimized.
(get-process pwsh | format-list | Out-String).Replace("`n","\n`n")Before:
After:
|
This comment has been minimized.
This comment has been minimized.
(dir | select -first 3 |Format-Table -GroupBy Name | out-string).replace("`n","\n`n")Before:
After:
|
This comment has been minimized.
This comment has been minimized.
|
Is it ok to have one '\n' before "Directory ..."? |
This comment has been minimized.
This comment has been minimized.
|
@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
| @@ -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 | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
SteveL-MSFT
Nov 13, 2018
Author
Member
Correct. Was running the tests locally and this line was outputting unncessarily
iSazonov
merged commit 43e0394
into
PowerShell:master
Nov 14, 2018
6 checks passed
CodeFactor
No issues found.
Details
PowerShell-CI-linux
#PR-8247-20181113.02 succeeded
Details
PowerShell-CI-macos
#PR-8247-20181113.02 succeeded
Details
PowerShell-CI-windows
#PR-8247-20181113.02 succeeded
Details
continuous-integration/appveyor/pr
AppVeyor build succeeded
Details
license/cla
All CLA requirements met.
Details
SteveL-MSFT
deleted the
SteveL-MSFT:format-whitespace
branch
Nov 14, 2018
adityapatwardhan
added
the
CL-Engine
label
Nov 15, 2018
This comment has been minimized.
This comment has been minimized.
|
@iSazonov Reminder to add |
iSazonov
referenced this pull request
Dec 28, 2018
Closed
while help an alias with *ending,like help dir* or help ls*,the output is in confusion #8541
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.
SteveL-MSFT commentedNov 13, 2018
•
edited
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