Closed ilya-lesikov closed 10 months ago
I see some units failing since they for some reason expect SuppressTrailingSpaces to also remove spaces in the beginning. I'll fix the tests if you are fine with the PR.
@ilya-lesikov Code looks okay to me, but you have to fix the failing unit-test along with it. Change the code in the test from:
tw.Style().Options = OptionsNoBordersAndSeparators
compareOutput(t, tw.Render(), `
ID TEXT1 DATE TEXT2
U2 Hey 2021-04-19 13:37 Yuh yuh yuh
S12 Uhhhh 2021-04-19 13:37 Some dummy data here
R123 Lobsters 2021-04-19 13:37 I like lobsters
R123 Some big name here and it's pretty big 2021-04-19 13:37 Abcdefghijklmnopqrstuvwxyz
R123 Small name 2021-04-19 13:37 Abcdefghijklmnopqrstuvwxyz`)
to:
tw.Style().Options = OptionsNoBordersAndSeparators
compareOutput(t, tw.Render(), `
ID TEXT1 DATE TEXT2
U2 Hey 2021-04-19 13:37 Yuh yuh yuh
S12 Uhhhh 2021-04-19 13:37 Some dummy data here
R123 Lobsters 2021-04-19 13:37 I like lobsters
R123 Some big name here and it's pretty big 2021-04-19 13:37 Abcdefghijklmnopqrstuvwxyz
R123 Small name 2021-04-19 13:37 Abcdefghijklmnopqrstuvwxyz`)
The new code has leading spaces in each line of output.
Kudos, no new issues were introduced!
0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Totals | |
---|---|
Change from base Build 7456312488: | 0.0% |
Covered Lines: | 3434 |
Relevant Lines: | 3434 |
@jedib0t Fixed units.
Thanks for the contribution @ilya-lesikov !
I've cut a release for your use: https://github.com/jedib0t/go-pretty/releases/tag/v6.5.4
Proposed Changes
mytable.SuppressTrailingSpaces()
suppressing not only trailing spaces, but also spaces from the beginning. This fixes it.Before fix
After fix