-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
rustfmt: run it on doc examples too #1368
Conversation
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.
I noticed that the indentation is a bit wierd for all the code examples where examples are built in functions. Can we either uncomment the function names or remove the functions? I did some research when I started working on rust-vmm, and most of the crates out there don't use functions that return results in examples without calling them. I assume that the reason is the code examples can fail silently with this approach. I think it is easier to keep the documentation up to date if the doc tests fail.
I did this. I do not understand what you mean by weird indentation. I just ran |
Here is an example where the lines have a weird indentation:
Even though the line let |
and format the code afterwards. Signed-off-by: Diana Popa <[email protected]>
Signed-off-by: Diana Popa <[email protected]>
99e1f24
to
1aefb25
Compare
I fixed those in another commit. Take a look. |
Ran rustfmt from the nightly build with format_code_in_doc_comments enabled.
Signed-off-by: Diana Popa [email protected]
Reason for This PR
Format the doc code examples -> better looking Firecracker
Description of Changes
[Author TODO: add description of changes.]
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.
PR Checklist
[Author TODO: Meet these criteria. Where there are two options, keep one.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]
git commit -s
).clearly provided.
doc changes are included in this PR. Docs in scope are all
*.md
fileslocated either in the repository root, or in the
docs/
directory.code is included in this PR.
reflected in
firecracker/swagger.yaml
.this PR have user impact and have been added to the
CHANGELOG.md
file.