Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Latest commit

 

History

History
61 lines (38 loc) · 2.53 KB

CONTRIBUTING.md

File metadata and controls

61 lines (38 loc) · 2.53 KB

Contributing

This repository is open to community contributions! Leafwing Studios attempts to adhere to the Rust API Guidelines. If you haven't seen it before, it's an excellent resource!

There are a few options if you'd like to help:

  1. File issues for bugs you find or new features you'd like.
  2. Read over and discuss issues, then make a PR that fixes them. Use "Fixes #X" in your PR description to automatically close the issue when the PR is merged.
  3. Review existing PRs, and leave thoughtful feedback. If you think a PR is ready to merge, hit "Approve" in your review!

Any contributions made are provided under the license(s) listed in this repo at the time of their contribution, and do not require separate attribution.

Testing

  1. Use doc tests aggressively to show how APIs should be used. You can use # to hide a setup line from the doc tests.
  2. Unit test belong near the code they are testing. Use #[cfg(test)] on the test module to ignore it during builds, and #[test] on the test functions to ensure they are run.
  3. Integration tests should be stored in the top level tests folder, importing functions from lib.rs.

Use cargo test to run all tests.

CI

The CI will:

  1. Ensure the code is formatted with cargo fmt.
  2. Ensure that the code compiles.
  3. Ensure that (almost) all clippy lints pass.
  4. Ensure all tests pass on Windows, MacOS and Ubuntu.

Check this locally with:

  1. cargo run -p ci
  2. cargo test --workspace

To manually rerun CI:

  1. Navigate to the Actions tab.
  2. Use the dropdown menu in the CI run of interest and select "View workflow file".
  3. In the top-right corner, select "Rerun workflow".

Documentation

Reference documentation is handled with standard Rust doc strings. Use cargo doc --open to build and then open the docs.

Design docs (or other book-format documentation) is handled with mdBook. Install it with cargo install mdbook, then use mdbook serve --open to launch the docs.

Benchmarking

To run the benchmarks, use cargo bench.

For more documentation on making your own benchmarks, check out criterion's docs.

Publishing your crate

This repository is designed to make publishing crates easy! Just follow cargo's directions and you'll be an official part of the Rust ecosystem in no time!