-
Notifications
You must be signed in to change notification settings - Fork 50
Revise doc comments for API reference style. #350
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
- Fix spelling error in parameter name (invertion --> inversion). - Add docs for parameters and return values. - Use indicative instead of imperative for method/function/initializer abstracts. (Match a regex. --> Matches a regex.) - Don't use code voice in abstracts, or symbol names as English nouns. - Use contractions per Apple style. - Turn /// comments that contain notes for this API's implementers into plain // comments, to omit that content from the docs. Move them before the /// comments, to keep doc comments immediately adjacent to the declaration they documents.
2ee6aec
to
ab308ee
Compare
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, @amartini51!
@hamishknight for regex parser comments |
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.
_RegexParser
changes LGTM, though I do not believe we will be exposing it as public API as it's an implementation-only dependency of _StringProcessing
.
Co-authored-by: Nate Cook <[email protected]>
@swift-ci test |
Looking at the CI builder failures, I don't think they came from this PR's changes, since everything except the spelling change to a parameter name is in comments. @natecook1000 Do you mind taking a look with me?
|
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.
You were adding a line of code here. Could you do a quick pass and make sure it's comments only again?
@swift-ci please test |
Confirmed (using the command below) that this branch now contains only changes to doc comments, changes to // comments where content was moved into or out of a doc comment, and one spelling correction to code. % git diff origin/main... | grep -v '^+ *///\|- *///' | grep -v '^@@' | grep -v '^ ' | grep -v '^+++\|^---' | grep -v '^diff --git' | grep -v '^index ' + // Individual public API functions are in the generated Variadics.swift file. +// For now, we use String as the source while prototyping... + + // NOTE: Currently, this means we have raw quotes. + // Better would be to have real Swift string delimiter parsing logic. + + // NOTE: traditional comments are not nested. Currently, we are neither. + // Traditional comments can't have `)`, not even escaped in them either, we + // can. Traditional comments can have `*/` in them, we can't without + // escaping. We don't currently do escaping. + - // Finish, flush, and clear. Returns the rendered output + // Finish, flush, and clear. + // + // - Returns: The rendered output. + // Note: The `Script` enum includes the "meta" script type "Katakana_Or_Hiragana", which + // isn't defined by https://www.unicode.org/Public/UCD/latest/ucd/Scripts.txt, + // but is defined by https://www.unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt. + // We may want to split it out, as it's the only case that is a union of + // other script types. + +// TODO: These should become aliases for the Block (blk) Unicode character +// property. + - // Ensures `.0` always refers to the whole match. - // Allows `.0` when `Match` is not a tuple. - func withInversion(_ invertion: Bool) -> Self { + func withInversion(_ inversion: Bool) -> Self { - if invertion { + if inversion {
@swift-ci Please test. |
abstracts. (Match a regex. → Matches a regex.)
///
comments that contain notes for this API's implementers into plain//
comments, to omit that content from the docs. Move them before the///
comments, to keep doc comments immediately adjacent to the declaration they documents.