|
| 1 | +## Contributing to Rustlings |
| 2 | + |
| 3 | +First off, thanks for taking the time to contribute!! ❤️ |
| 4 | + |
| 5 | +### Quick Reference |
| 6 | + |
| 7 | +I want to... |
| 8 | + |
| 9 | +_update an outdated exercise! ➡️ [open a Pull Request](#prs)_ |
| 10 | + |
| 11 | +_report a bug! ➡️ [open an Issue](#issues)_ |
| 12 | + |
| 13 | +_fix a bug! ➡️ [open a Pull Request](#prs)_ |
| 14 | + |
| 15 | +_implement a new feature! ➡️ [open an Issue to discuss it first, then a Pull Request](#issues)_ |
| 16 | + |
| 17 | +<a name="issues"></a> |
| 18 | +### Issues |
| 19 | + |
| 20 | +You can open an issue [here](https://github.com/rust-lang/rustlings/issues/new). |
| 21 | +If you're reporting a bug, please include the output of the following commands: |
| 22 | + |
| 23 | +- `rustc --version` |
| 24 | +- `rustlings --version` |
| 25 | +- `ls -la` |
| 26 | +- Your OS name and version |
| 27 | + |
| 28 | +<a name="prs"></a> |
| 29 | +### Pull Requests |
| 30 | + |
| 31 | +Opening a pull request is as easy as forking the repository and committing your |
| 32 | +changes. There's a couple of things to watch out for: |
| 33 | + |
| 34 | +#### Write correct commit messages |
| 35 | + |
| 36 | +We follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) |
| 37 | +specification, because it makes it easier to generate changelogs automatically. |
| 38 | +This means that you have to format your commit messages in a specific way. Say |
| 39 | +you're working on adding a new exercise called `foobar1.rs`. You could write |
| 40 | +the following commit message: |
| 41 | + |
| 42 | +``` |
| 43 | +feat: Add foobar1.rs exercise |
| 44 | +``` |
| 45 | + |
| 46 | +If you're just fixing a bug, please use the `fix` type: |
| 47 | + |
| 48 | +``` |
| 49 | +fix(verify): Make sure verify doesn't self-destruct |
| 50 | +``` |
| 51 | + |
| 52 | +The scope within the brackets is optional, but should be any of these: |
| 53 | + |
| 54 | +- `installation` (for the installation script) |
| 55 | +- `cli` (for general CLI changes) |
| 56 | +- `verify` (for the verification source file) |
| 57 | +- `watch` (for the watch functionality source) |
| 58 | +- `run` (for the run functionality source) |
| 59 | +- `EXERCISENAME` (if you're changing a specific exercise, or set of exercises, |
| 60 | + substitute them here) |
| 61 | + |
| 62 | +When the commit also happens to close an existing issue, link it in the message |
| 63 | +body: |
| 64 | + |
| 65 | +``` |
| 66 | +fix: Update foobar |
| 67 | +
|
| 68 | +closes #101029908 |
| 69 | +``` |
| 70 | + |
| 71 | +If you're doing simple changes, like updating a book link, use `chore`: |
| 72 | + |
| 73 | +``` |
| 74 | +chore: Update exercise1.rs book link |
| 75 | +``` |
| 76 | + |
| 77 | +If you're updating documentation, use `docs`: |
| 78 | + |
| 79 | +``` |
| 80 | +docs: Add more information to Readme |
| 81 | +``` |
| 82 | + |
| 83 | +If, and only if, you're absolutely sure you want to make a breaking change |
| 84 | +(please discuss this beforehand!), add an exclamation mark to the type and |
| 85 | +explain the breaking change in the message body: |
| 86 | + |
| 87 | +``` |
| 88 | +fix!: Completely change verification |
| 89 | +
|
| 90 | +BREAKING CHANGE: This has to be done because lorem ipsum dolor |
| 91 | +``` |
| 92 | + |
| 93 | +#### Pull Request Workflow |
| 94 | + |
| 95 | +Once you open a Pull Request, it may be reviewed or labeled (or both) until |
| 96 | +the maintainers accept your change. Then, [bors](https://github.com/bors) will |
| 97 | +run the test suite with your changes and if it's successful, automatically |
| 98 | +merge it in! |
0 commit comments