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
feat: add text justification style #2410
feat: add text justification style #2410
Conversation
It looks strange to me that there is no space on the left when it's left-justified, but there is a space on the right when it's right-justified. |
@timcassell |
That sound reasonable to me. Especially since the old test expects it (but seems broken currently). |
@timcassell |
This is fixed in the second commit |
...AllValuesVerifyTests.BenchmarkShouldProduceSummary_WithNotAllowedFlagsEnumError.verified.txt
Outdated
Show resolved
Hide resolved
@timcassell |
...es/ParamsAllValuesVerifyTests.BenchmarkShouldProduceSummary_WithAllValuesOfBool.verified.txt
Outdated
Show resolved
Hide resolved
...es/ParamsAllValuesVerifyTests.BenchmarkShouldProduceSummary_WithAllValuesOfBool.verified.txt
Outdated
Show resolved
Hide resolved
@timcassell |
It's unrelated. Those tests are flaky. |
...kDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_ru-RU.verified.txt
Outdated
Show resolved
Hide resolved
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.
Thanks @Vahdanian!
You're very welcome! I'm glad I could contribute to the project 😄 |
Hi, thanks for reviewing my pull request. This pull request intends to fix [https://github.com//issues/1995](this issue)
Here are some key points worth mentioning:
1- After initial investigation, I found that Justify property in "SummaryTableColumn" class does not have impact on aligning the contents of summary table. It only effects the header separator of table. (See the first attachment please)
2- I managed to add the "DefaultTextJustification" property to "SummaryStyle" and use the style to set "Justify" property inside "SummaryTableColumn". I changed the "BuildStandardText" and "BuildBoldText" methods to use "Justify" property.
3- Since I changed how the Justify Property was being initialized and the previous value was only used inside "GetJustificationIndicator" method, I changed the method to read from "IsNumeric" value of passed column. Exactly like the previous value of "Justify" property
4- I modified SummaryTableTests class and added a new method to MockFactory class to test the new style. CreateSummary method inside MockFactory did not used the specified style of config object and directly called the constructor of Summary class where style was initialized with default instance. So I added a new parameter for style.
5- Finally I modified methods "SummaryStyle" class and added a new method in "HashCode" struct to support the newly added style "DefaultTextJustification".
6- You can see the final result in second attachment.