-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
FindGuid helper function #3762
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 |
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.
Overall looks good, but let's make it a std::optional<GUID>
} | ||
} | ||
|
||
return profileGuid; |
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.
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.
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.
Sure thing
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.
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
noexcept
to comply with assumption made by otherCascadiaSettings
functions thatProfiles::GetGuid
does 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
SettingsTests
calledTestHelperFunctions
to validate the new functionFindGuid
and older functionFindProfile
. This test group could be used to validate more helper functions inCascadiaSettings
as they're added. The new test group passes after runningte.exe TerminalApp.LocalTests.dll
.