| 1 | # Contributing to Criterion.<span></span>rs |
| 2 | |
| 3 | ## Ideas, Experiences and Questions |
| 4 | |
| 5 | The easiest way to contribute to Criterion.<span></span>rs is to use it and report your experiences, ask questions and contribute ideas. We'd love to hear your thoughts on how to make Criterion.<span></span>rs better, or your comments on why you are or are not currently using it. |
| 6 | |
| 7 | Issues, ideas, requests and questions should be posted on the issue tracker at: |
| 8 | |
| 9 | https://github.com/bheisler/criterion.rs/issues |
| 10 | |
| 11 | ## A Note on Dependency Updates |
| 12 | |
| 13 | Criterion.<span></span>rs does not accept pull requests to update dependencies unless specifically |
| 14 | requested by the maintainer(s). Dependencies are updated manually by the maintainer(s) before each |
| 15 | new release. |
| 16 | |
| 17 | ## Code |
| 18 | |
| 19 | Pull requests are welcome, though please raise an issue for discussion first if none exists. We're happy to assist new contributors. |
| 20 | |
| 21 | If you're not sure what to work on, try checking the [Beginner label](https://github.com/bheisler/criterion.rs/issues?q=is%3Aissue+is%3Aopen+label%3ABeginner) |
| 22 | |
| 23 | To make changes to the code, fork the repo and clone it: |
| 24 | |
| 25 | `git clone [email protected]:your-username/criterion.rs.git` |
| 26 | |
| 27 | You'll probably want to install [gnuplot](http://www.gnuplot.info/) as well. See the gnuplot website for installation instructions. |
| 28 | |
| 29 | Then make your changes to the code. When you're done, run the tests: |
| 30 | |
| 31 | ``` |
| 32 | cargo test --all |
| 33 | cargo bench |
| 34 | ``` |
| 35 | |
| 36 | It's a good idea to run `clippy` and fix any warnings as well: |
| 37 | |
| 38 | ``` |
| 39 | rustup component add clippy |
| 40 | cargo clippy --workspace --all-targets |
| 41 | ``` |
| 42 | |
| 43 | Finally, run Rustfmt to maintain a common code style: |
| 44 | |
| 45 | ``` |
| 46 | rustup component add rustfmt-preview |
| 47 | cargo fmt --all |
| 48 | ``` |
| 49 | |
| 50 | Don't forget to update the CHANGELOG.md file and any appropriate documentation. Once you're finished, push to your fork and submit a pull request. We try to respond to new issues and pull requests quickly, so if there hasn't been any response for more than a few days feel free to ping @bheisler. |
| 51 | |
| 52 | Some things that will increase the chance that your pull request is accepted: |
| 53 | |
| 54 | * Write tests |
| 55 | * Clearly document public methods |
| 56 | * Write a good commit message |
| 57 | |
| 58 | ## Branches |
| 59 | |
| 60 | * PRs with breaking changes are made against the unreleased branch. e.g. branch version-0.4 |
| 61 | * PRs without breaking changes are made against the master branch. |
| 62 | |
| 63 | If you're not sure which branch to use just start with master, as this can be changed during review. |
| 64 | |
| 65 | When it is time to release the unreleased branch, a PR is made from the unreleased branch to master. e.g. https://github.com/bheisler/criterion.rs/pull/496 |
| 66 | |
| 67 | ## Github Labels |
| 68 | |
| 69 | Criterion.<span></span>rs uses a simple set of labels to track issues. Most important are the |
| 70 | difficulty labels: |
| 71 | |
| 72 | * Beginner - Suitable for people new to Criterion.rs, or even new to Rust in general |
| 73 | * Intermediate - More challenging, likely involves some non-trivial design decisions and/or knowledge |
| 74 | of Criterion.<span></span>rs' internals |
| 75 | * Bigger Project - Large and/or complex project such as designing a complex new feature |
| 76 | |
| 77 | Additionally, there are a few other noteworthy labels: |
| 78 | |
| 79 | * Breaking Change - Fixing this will have to wait until the next breaking-change release |
| 80 | * Bug - Something isn't working right |
| 81 | * Enhancement - Request to add a new feature or otherwise improve Criterion.<span></span>rs in some way |
| 82 | |
| 83 | ## Code of Conduct |
| 84 | |
| 85 | We follow the [Rust Code of Conduct](http://www.rust-lang.org/conduct.html). |