-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ci: add check for doc comment formatting #18542
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?
ci: add check for doc comment formatting #18542
Conversation
cadd5fb to
6f7c4fa
Compare
305c31c to
2c1d0d6
Compare
2c1d0d6 to
0ed928f
Compare
|
Hi @alamb , Following the discussion in PR #16916, I've prepared this PR to enable CI enforcement for doc comment formatting. As you mentioned, we need to use the same version of This PR contains two commits:
PTAL when you have chance. Thank you! |
alamb
left a comment
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.
Thanks @CuteChuanChuan -- this looks really close. I think we just need to update where the command is run and this will be good to go from my perspective
Thank you for sticking with it
- Install nightly Rust toolchain with rustfmt component - Use cargo +nightly fmt to check both regular code and doc comments - Replace stable fmt check with nightly to avoid formatting conflicts
481a43d to
bb6cfcf
Compare
bb6cfcf to
3d932e2
Compare
3d932e2 to
dfdd028
Compare
|
Hi @alamb , Sorry for the late response. I've moved the nightly fmt command to |
Which issue does this PR close?
Rationale for this change
This PR adds CI enforcement to ensure all code examples in documentation comments are properly formatted to maintain consistent code formatting, including examples in doc comments.
What changes are included in this PR?
This PR adds a new CI check in the
check-fmtjob that:cargo +nightly fmt --all -- --check --config format_code_in_doc_comments=trueNote:
format_code_in_doc_commentsis currently an unstable feature.Are these changes tested?
The command is tested locally with:
Are there any user-facing changes?
No user-facing changes.