-
Notifications
You must be signed in to change notification settings - Fork 470
ci: validate internal doc comments match markdown documentation #32074
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Petros Angelatos <[email protected]>
Signed-off-by: Petros Angelatos <[email protected]>
Signed-off-by: Petros Angelatos <[email protected]>
6bce7f8
to
683da24
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.
Looks good, thank you! Left a comment inline.
@@ -106,7 +124,8 @@ def main() -> None: | |||
elif "array" in type_name: | |||
type_name = "array" | |||
type_name = type_name.replace(" ", "␠") | |||
print(" ".join([str(position), field, type_name])) | |||
documentation = documentation.replace(" ", "␠") | |||
print(" ".join([field, type_name, documentation])) | |||
position += 1 |
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.
Probably don't need position
anymore?
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.
😍
field = FIELD_NAME_RE.search(fields[0]).group(1) | ||
type_name = FIELD_TYPE_RE.search(fields[1]).group(1) | ||
documentation = DOC_LINK_TYPE1_RE.sub(r"\1", fields[2]) | ||
documentation = DOC_LINK_TYPE2_RE.sub(r"\1", documentation) |
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.
Why is documentation being assigned twice? Edit: I guess it makes sense, just doing two substitutions. I would have just nested them.
Motivation
This is a follow up PR from my previous work that will ensure the field documentation we publish in our docs is also reflected as comments in the product. Having it as a CI step will ensure the two will stay in sync.
Tips for reviewer
The last commit is pure code gen and is marked as such
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.