-
Notifications
You must be signed in to change notification settings - Fork 616
Fix yaml formatting in go comments #12969
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?
Fix yaml formatting in go comments #12969
Conversation
|
@Rachael-Graham You can fix the verify check by running |
3c2c723 to
b23b5a1
Compare
Signed-off-by: Rachael Graham <[email protected]>
Signed-off-by: Rachael Graham <[email protected]>
Signed-off-by: Rachael Graham <[email protected]>
Signed-off-by: John Howard <[email protected]> Signed-off-by: Rachael Graham <[email protected]>
b23b5a1 to
262aec0
Compare
Signed-off-by: Rachael Graham <[email protected]>
Signed-off-by: Rachael Graham <[email protected]>
| - third_party$ | ||
| - builtin$ | ||
| - examples$ | ||
| - api/v1alpha1/ai_policy.go |
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.
Any idea on why this was necessary?
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.
Yes - gofmt was changing the spaces in any codeblocks in the comment to tabs, and adding extra empty lines within the codeblocks that was breaking the yaml. I think gofmt has special handling for indented text in comments - it assumes they're code examples and applies Go formatting like tabs instead of spaces. but it ends up breaking them
I added api/v1alpha1/ai_policy.go to the formatting exclusions in .golangci.yaml to preserve the yaml anytime someone generates the code. but idk if this the best solution long term. I could at the very least add a comment here explaining?
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.
a comment here would be useful. also, should we just exclude everything in the api/v1alpha1 directory?
Description
Noticed some weird formatting in the rendered api docs that are autogenerated from go code. Updated the yaml formatting for spacing and some missing lines in comments.
Change Type
Changelog
Additional Notes