Fix table format not adding padding for right justified column#7136
Merged
iSazonov merged 1 commit intoPowerShell:masterfrom Jun 26, 2018
Merged
Fix table format not adding padding for right justified column#7136iSazonov merged 1 commit intoPowerShell:masterfrom
iSazonov merged 1 commit intoPowerShell:masterfrom
Conversation
iSazonov
reviewed
Jun 22, 2018
|
|
||
| a b | ||
| - - | ||
| 123 abc |
Collaborator
There was a problem hiding this comment.
Interesting,
- should we justify header fields? Maybe always have left/center/right justify?
- should we pad "-" to length of values not headers?
a b
--- ---
123 abc
Member
Author
There was a problem hiding this comment.
Maybe, but that's an enhancement. I would suggest opening a new issue to discuss that. This PR makes this consistent with Windows PowerShell existing behavior.
There was a problem hiding this comment.
Does this mean that this issue only happens on PS Core?
Member
Author
There was a problem hiding this comment.
@anmenaga yes, this is a regression in PSCore6.1
anmenaga
approved these changes
Jun 22, 2018
|
|
||
| a b | ||
| - - | ||
| 123 abc |
There was a problem hiding this comment.
Does this mean that this issue only happens on PS Core?
iSazonov
approved these changes
Jun 22, 2018
daxian-dbw
added a commit
that referenced
this pull request
Jun 26, 2018
This reverts commit e8d2a6b.
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
Table formatter was overly aggressive in removing padding so even right justified output (default of numbers) gets incorrectly stripped of padding. Fix is when right justified, always add padding (because it's right justified, there's never trailing whitespace).
Note that the GitHub diff view is confused about the new test case since the code is similar. Didn't want to add more variations to the previous test case as the intent is different even though the code is similar.
Fix #7078
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