-
Notifications
You must be signed in to change notification settings - Fork 39
new: add optional HELP line support #130
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
Conversation
Finalizes #127 |
Signed-off-by: Melissa Kilby <[email protected]>
return true | ||
} | ||
|
||
fileprivate func isValidHelpText() -> Bool { |
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.
As a security person string sanitization always scares me as you usually get it wrong. Would you have better ideas here?
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 guess we could "....".allSatisfy { character in character.isLetter || character.isNumber || punctuation?? }
but also allow punctuation etc, or lean into CharacterSet from Foundation...
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.
ACK, I'll check tmrw and possibly re-push the last commit and add that in.
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.
@ktoso besides adding all overloads, I refactored the HelpText
sanitization a bit, however still without Foundation in order to limit some side-effects (such as increasing the binary size for adopters).
Would you be able to review these changes? Much appreciated ❤️
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.
looks good, minor nitpick
Notably, add consistent overloads to maintain ABI stability Plus adjust `ValidHelpText` approach for broader robustness Signed-off-by: Melissa Kilby <[email protected]> Co-authored-by: Konrad `ktoso` Malawski <[email protected]>
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.
LGTM, thank you!
Add optional HELP line support (includes help text validation and sanitization).
Follow for #126
CC @ktoso @FranzBusch thanks in advance for your review!