2024-04-25 19:19:52 -04:00
|
|
|
# Contributing to Rustlings
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
First off, thanks for taking the time to contribute! ❤️
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
## Quick Reference
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
I want to …
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
- _report a bug!_ ➡️ [open an issue](#issues)
|
|
|
|
- _fix a bug!_ ➡️ [open a pull request](#pull-requests)
|
|
|
|
- _implement a new feature!_ ➡️ [open an issue to discuss it first, then a pull request](#issues)
|
|
|
|
- _add an exercise!_ ➡️ [read this](#adding-an-exercise)
|
|
|
|
- _update an outdated exercise!_ ➡️ [open a pull request](#pull-requests)
|
2019-06-09 08:46:38 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
## Issues
|
2019-06-09 08:39:00 -04:00
|
|
|
|
|
|
|
You can open an issue [here](https://github.com/rust-lang/rustlings/issues/new).
|
|
|
|
If you're reporting a bug, please include the output of the following commands:
|
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
- `cargo --version`
|
2019-06-09 08:39:00 -04:00
|
|
|
- `rustlings --version`
|
|
|
|
- `ls -la`
|
|
|
|
- Your OS name and version
|
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
## Pull Requests
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
You are welcome to open a pull request, but unless it is small and trivial, **please open an issue to discuss your idea first** 🙏🏼
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
Opening a pull request is as easy as forking the repository and committing your changes.
|
|
|
|
If you need any help with it or face any Git related problems, don't hesitate to ask for help 🤗
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
It may take time to review your pull request.
|
|
|
|
Please be patient 😇
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
## Adding An Exercise
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
- Name the file `exercises/yourTopic/yourTopicN.rs`.
|
|
|
|
- Make sure to put in some helpful links, and link to sections of the book in `exercises/yourTopic/README.md`.
|
|
|
|
- Add a (possible) solution at `solutions/yourTopic/yourTopicN.rs` with comments and links explaining it.
|
2024-05-12 19:25:38 -04:00
|
|
|
- Add the [metadata for your exercise](#exercise-metadata) in the `rustlings-macros/info.toml` file.
|
2024-04-25 19:19:52 -04:00
|
|
|
- Make sure your exercise runs with `rustlings run yourTopicN`.
|
|
|
|
- [Open a pull request](#pull-requests).
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
### Exercise Metadata
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
The exercise metadata should contain the following:
|
2019-06-09 08:39:00 -04:00
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
```toml
|
|
|
|
[[exercises]]
|
|
|
|
name = "yourTopicN"
|
|
|
|
dir = "yourTopic"
|
|
|
|
hint = """A useful (multi-line) hint for your exercise."""
|
2019-06-09 08:39:00 -04:00
|
|
|
```
|
|
|
|
|
2024-04-25 19:19:52 -04:00
|
|
|
If your exercise doesn't contain any test, add `test = false` to the exercise metadata.
|
|
|
|
But adding tests is recommended.
|