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

Conversation

Projects
None yet
3 participants
@ppannuto
Copy link
Member

ppannuto commented Jul 19, 2018

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 added some commits Jul 19, 2018

@bradjc

bradjc approved these changes Jul 20, 2018

@niklasad1

This comment has been minimized.

Copy link
Member

niklasad1 commented Jul 20, 2018

bors r+

bors bot added a commit that referenced this pull request Jul 20, 2018

Merge #1128
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

This comment has been minimized.

Copy link
Contributor

bors bot commented Jul 20, 2018

@bors bors bot merged commit 27e1420 into master Jul 20, 2018

4 checks passed

bors Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@bors bors bot deleted the kernel-doctests branch Jul 20, 2018

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