Skip to content
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

Kernel doctests #1128

Merged
merged 2 commits into from Jul 20, 2018
Merged

Kernel doctests #1128

merged 2 commits into from Jul 20, 2018

Conversation

ppannuto
Copy link
Member

Pull Request Overview

This adds CI checks to validate that our example code in documentation is correct by running doctests. This also fixes up some broken documentation :)

This PR is just for the kernel crate.

Some notes:

  • Lines prefixed with # in doc comments are not rendered
  • All fenced blocks are assumed to be rust unless stated otherwise, so rustdoc repurposes the code identifier a bit, e.g. a block with ```ignore will render as rust code but will not be tested
  • The peripherals docs are a bit messy to look at in source code form. Personally I think this is a shortcoming of rustdoc, but I think it's good to see an example of how you handle situations where there's a sort of "continuing example" throughout the documentation (you have to keep repeating the "hidden" code with # )

Testing Strategy

Compiling.

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make formatall.

@ppannuto ppannuto added bug documentation P-Upkeep This a relatively minor change, or one that is limited in scope, and requires less scrutiny. labels Jul 19, 2018
@niklasad1
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Jul 20, 2018
1128: Kernel doctests r=niklasad1 a=ppannuto

### Pull Request Overview

This adds CI checks to validate that our example code in documentation is correct by running doctests. This also fixes up some broken documentation :)

This PR is just for the kernel crate.

Some notes:

 - Lines prefixed with `# ` in doc comments are not rendered
 - All fenced blocks are assumed to be rust unless stated otherwise, so rustdoc repurposes the code identifier a bit, e.g. a block with ` ```ignore ` will render as rust code but will not be tested
 - The peripherals docs are a bit messy to look at in source code form. Personally I think this is a shortcoming of rustdoc, but I think it's good to see an example of how you handle situations where there's a sort of "continuing example" throughout the documentation (you have to keep repeating the "hidden" code with `# `)

### Testing Strategy

Compiling.

### Documentation Updated

- [x] Updated the relevant files in `/docs`, or no updates are required.

### Formatting

- [x] Ran `make formatall`.


Co-authored-by: Pat Pannuto <pat.pannuto@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 20, 2018

Build succeeded

@bors bors bot merged commit 27e1420 into master Jul 20, 2018
@bors bors bot deleted the kernel-doctests branch July 20, 2018 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug documentation P-Upkeep This a relatively minor change, or one that is limited in scope, and requires less scrutiny.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants