|
1 | 1 | # Contribution guide |
| 2 | + |
| 3 | +Thank you for your interest in contributing to chalk! There are many ways to |
| 4 | +contribute, and we appreciate all of them. |
| 5 | + |
| 6 | +* [Bug Reports](#bug-reports) |
| 7 | +* [Running and Debugging](#running-and-debugging) |
| 8 | +* [Pull Requests](#pull-requests) |
| 9 | +* [Writing Documentation](#writing-documentation) |
| 10 | + |
| 11 | +If you'd like to contribute, consider joining the [Traits Working Group][traits-working-group]. |
| 12 | +We hang out on the [rust-lang zulip][rust-lang-zulip] in the [#wg-traits][wg-traits-stream] stream. |
| 13 | + |
| 14 | +As a reminder, all contributors are expected to follow our [Code of Conduct][coc]. |
| 15 | + |
| 16 | +[traits-working-group]: https://rust-lang.github.io/compiler-team/working-groups/traits/ |
| 17 | +[rust-lang-zulip]:https://rust-lang.zulipchat.com |
| 18 | +[wg-traits-stream]: https://rust-lang.zulipchat.com/#narrow/stream/144729-wg-traits |
| 19 | +[coc]: https://www.rust-lang.org/conduct.html |
| 20 | + |
| 21 | +## Bug Reports |
| 22 | +[bug-reports]: #bug-reports |
| 23 | + |
| 24 | +While bugs are unfortunate, they're a reality in software. We can't fix what we |
| 25 | +don't know about, so please report liberally. If you're not sure if something |
| 26 | +is a bug or not, feel free to file a bug anyway. |
| 27 | + |
| 28 | +If you have the chance, before reporting a bug, please search existing issues, |
| 29 | +as it's possible that someone else has already reported your error. This doesn't |
| 30 | +always work, and sometimes it's hard to know what to search for, so consider |
| 31 | +this extra credit. We won't mind if you accidentally file a duplicate report. |
| 32 | + |
| 33 | +Sometimes, a backtrace is helpful, and so including that is nice. To get |
| 34 | +a backtrace, set the `RUST_BACKTRACE` environment variable to a value |
| 35 | +other than `0`. The easiest way to do this is to invoke `chalk` like this: |
| 36 | + |
| 37 | +```bash |
| 38 | +$ RUST_BACKTRACE=1 chalk ... |
| 39 | +``` |
| 40 | + |
| 41 | +## Running and Debugging |
| 42 | +[running-and-debugging]: #running-and-debugging |
| 43 | +There is a repl mainly for debugging purposes which can be run by `cargo run`. Some basic examples are in [libstd.chalk](https://github.com/rust-lang/chalk/blob/master/libstd.chalk): |
| 44 | +```bash |
| 45 | +$ cargo run |
| 46 | +?- load libstd.chalk |
| 47 | +?- Vec<Box<i32>>: Clone |
| 48 | +Unique; substitution [], lifetime constraints [] |
| 49 | +``` |
| 50 | + |
| 51 | +More logging can be enabled by setting the `CHALK_DEBUG` environment variable. Set `CHALK_DEBUG=1` to see `info!(...)` output, and `CHALK_DEBUG=2` to see `debug!(...)` output as well. |
| 52 | + |
| 53 | +## Pull Requests |
| 54 | +[pull-requests]: #pull-requests |
| 55 | + |
| 56 | +Pull requests are the primary mechanism we use to change Rust. GitHub itself |
| 57 | +has some [great documentation][pull-request-documentation] on using the Pull Request feature. |
| 58 | +We use the "fork and pull" model [described here][development-models], where |
| 59 | +contributors push changes to their personal fork and create pull requests to |
| 60 | +bring those changes into the source repository. |
| 61 | + |
| 62 | +Please make pull requests against the `master` branch. |
| 63 | + |
| 64 | +[pull-request-documentation]: https://help.github.com/articles/about-pull-requests/ |
| 65 | +[development-models]: https://help.github.com/articles/about-collaborative-development-models/ |
| 66 | + |
| 67 | +## Writing Documentation |
| 68 | +[writing-documentation]: #writing-documentation |
| 69 | + |
| 70 | +Documentation improvements are very welcome. Documentation pull requests |
| 71 | +function in the same way as other pull requests. |
| 72 | + |
| 73 | +You can find documentation style guidelines in [RFC 1574][rfc1574]. |
| 74 | + |
| 75 | +[rfc1574]: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text |
0 commit comments