-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Fix table format not adding padding for right justified column #7136
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
| a b | ||
| - - | ||
| 123 abc |
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.
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
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that this issue only happens on PS Core?
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.
@anmenaga yes, this is a regression in PSCore6.1
| a b | ||
| - - | ||
| 123 abc |
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.
Does this mean that this issue only happens on PS Core?
powercode
left a comment
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.
LGTM
This reverts commit e8d2a6b.
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