-
-
Notifications
You must be signed in to change notification settings - Fork 524
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
Conditionally trim trailing periods of argument and option descriptions #1740
base: main
Are you sure you want to change the base?
Conditionally trim trailing periods of argument and option descriptions #1740
Conversation
@microsoft-github-policy-service agree |
Thanks, I'll try to review this one over the weekend. |
Hello @TheTonttu, thank you for the contribution. My brain isn't fully functional today, however it looks like there is one more change required in this PR. Take one of the expectations, say I believe this line needs normalising too: Can you please check and see if you concur? If so, make the change and repush. |
PS. @TheTonttu I plan to review/merge this #1717 soon, so if it's before your next push, you'll need to rebase and update accordingly. |
Good catch, I'll make an update soon™. |
The change affected quite many test cases. |
It looks ok to me, /// <summary>
/// Gets or sets a value indicating whether a trailing period of a command description is trimmed in the help text.
/// </summary>
bool TrimTrailingPeriod { get; set; } Prior to your PR, the actual command description wouldn't ever be trimmed! I just want to triple check with one of our other maintainers over the weekend first... |
Note to self: The more I think about the idea of The trim only ever happens on text entered by the Spectre.Console application developer, and it's compile time text rather than dynamic somehow (ie. it's known in advance) - so why on earth do we have a property to offer to trim their explicitly entered text? If they want it trimmed, then simply don't use a period at the end. Furthermore, the trim is defaulting to I think I'm in favour of marking the property as obsolete and also changing its default to |
Changed the Should_Not_Trim_Description_Trailing_Period test case to output help with descriptions for command, argument, and option.
…u localizations Chinese (zh-Hans), Japanese (jp), and Korean (ko) localizations were not touched because I'm not sure about the punctuation rules for those languages. I think Chinese and Japanese mostly use 。(Ideographic Full Stop) for ending horizontal sentence. Modern Korean seems to use western punctuation marks.
6e87d41
to
33178a2
Compare
Yeah, the trailing period trimming really only makes sense if app developer wants to remove them from the built-in descriptions but it doesn't work with languages that use something else than period to end a sentence. Ideally there would just be convenient interface to customize the built-in descriptions. For now I rebased the feature branch to the latest main branch and added periods to the new Italian, Portuguese, and Russian help and version description localizations. I didn't touch the Chinese, Japanese and Korean localizations because I'm not familiar with the punctuation rules. As far as I know, Chinese and Japanese use 。(Ideographic full stop) for horizontal text and modern Korean uses western punctuation marks. |
fixes #1729
Changes
HelpProvider.TrimTrailingPeriod
property affects trailing period of argument and option descriptions in addition to command descriptions.Please upvote 👍 this pull request if you are interested in it.