mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 05:52:23 -05:00
rework contribution guide for the new toml file
This commit is contained in:
parent
70e59cca3c
commit
10d4d61d19
1 changed files with 8 additions and 6 deletions
14
README.md
14
README.md
|
@ -105,18 +105,20 @@ If you are interested in improving or adding new ones, please feel free to contr
|
||||||
First step is to add the exercise! Call it `exercises/yourTopic/yourTopicN.rs`, make sure to
|
First step is to add the exercise! Call it `exercises/yourTopic/yourTopicN.rs`, make sure to
|
||||||
put in some helpful links, and link to sections of the book in `exercises/yourTopic/README.md`.
|
put in some helpful links, and link to sections of the book in `exercises/yourTopic/README.md`.
|
||||||
|
|
||||||
Then, you'll want to make sure it gets verified when you run `rustlings verify`. Open `src/verify.rs` and
|
Next you want to make sure it runs when using `rustlings`. All exercises are stored in `info.toml`, under the `exercises` array. They're ordered by the order they're ran when using `rustlings verify`.
|
||||||
put your exercise somewhere in there:
|
|
||||||
|
|
||||||
|
You want to make sure where in the file you add your exercise. If you're not sure, add it at the bottom and ask in your pull request. To add an exercise, edit the file like this:
|
||||||
```diff
|
```diff
|
||||||
...
|
...
|
||||||
compile_only("exercises/functions5.rs")?;
|
+ [[exercises]]
|
||||||
+ compile_only("exercises/yourTopic/yourTopicN.rs")?;
|
+ path = "exercises/yourTopic/yourTopicN.rs"
|
||||||
compile_only("exercises/test1.rs")?;
|
+ mode = "compile"
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
That's all!
|
The `mode` attribute decides whether Rustlings will only compile your exercise, or compile and test it. If you have tests to verify in your exercise, choose `test`, otherwise `compile`.
|
||||||
|
|
||||||
|
That's all! Feel free to put up a pull request.
|
||||||
|
|
||||||
### Working on the source code
|
### Working on the source code
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue