Skip to content

Conversation

@Rachael-Graham
Copy link
Contributor

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

/kind documentation

Changelog

NONE

Additional Notes

@timflannagan
Copy link
Member

@Rachael-Graham You can fix the verify check by running make generate-all locally. The DCO check is failing though. There's some instructions on how to get it green (the tl;dr is you need to sign your commits).

@Rachael-Graham Rachael-Graham force-pushed the rlg-api-comment-fix branch 2 times, most recently from 3c2c723 to b23b5a1 Compare November 25, 2025 16:32
Rachael-Graham and others added 4 commits November 25, 2025 10:41
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]>
- third_party$
- builtin$
- examples$
- api/v1alpha1/ai_policy.go
Copy link
Member

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?

Copy link
Contributor Author

@Rachael-Graham Rachael-Graham Nov 25, 2025

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?

Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants