FindGuid helper function#3762
Conversation
No feedback from the Azure pipeline
|
Does anyone know why the code formatting is failing? The Azure pipeline provides no feedback. |
|
Look at this for code format : https://github.com/microsoft/terminal/blob/master/doc/building.md |
zadjii-msft
left a comment
There was a problem hiding this comment.
Overall looks good, but let's make it a std::optional<GUID>
| } | ||
| } | ||
|
|
||
| return profileGuid; |
There was a problem hiding this comment.
I think my only real comment is that I think I'd prefer that we make this function return a std::optional<GUID>, and return std::nullopt when we didn't find a match instead of returning the null GUID, since the null GUID is technically a valid GUID.
DHowett-MSFT
left a comment
There was a problem hiding this comment.
Love this. Thank you!
|
Thanks for the contribution! |
Summary of the Pull Request
Adds a simple helper function to look up the GUID associated with a profile name.
References
PR Checklist
SettingsTests!Detailed Description of the Pull Request / Additional comments
Very simple function, for-each through profiles checking for a match. Returns the associated GUID if found, else returns the null GUID.
This function is marked as
noexceptto comply with assumption made by otherCascadiaSettingsfunctions thatProfiles::GetGuiddoes not throw, despite it throwing.Validation Steps Performed
The new function is simple and can be visually validated, but added tests regardless. A new test group was added in
SettingsTestscalledTestHelperFunctionsto validate the new functionFindGuidand older functionFindProfile. This test group could be used to validate more helper functions inCascadiaSettingsas they're added. The new test group passes after runningte.exe TerminalApp.LocalTests.dll.