2019-09-15 22:43:10 +02:00
|
|
|
# Contributing
|
2021-10-27 13:45:37 +02:00
|
|
|
|
2019-09-15 22:43:10 +02:00
|
|
|
## New features
|
2021-10-27 13:45:37 +02:00
|
|
|
|
|
|
|
New features should go through the [RFC process][rfcs] before creating a Pull Request to this repository.
|
2019-09-15 22:43:10 +02:00
|
|
|
|
2022-02-15 18:30:54 +01:00
|
|
|
[rfcs]: https://github.com/rtic-rs/rfcs
|
2019-09-15 22:43:10 +02:00
|
|
|
|
|
|
|
## Bugs
|
2021-10-27 13:45:37 +02:00
|
|
|
|
2019-09-15 22:43:10 +02:00
|
|
|
Report bugs by creating an issue in this repository.
|
|
|
|
|
2021-10-27 13:45:37 +02:00
|
|
|
## Pull Requests (PRs)
|
|
|
|
|
2019-09-15 22:43:10 +02:00
|
|
|
Please make pull requests against the master branch.
|
|
|
|
|
|
|
|
Always use rebase instead of merge when bringing in changes from master to your feature branch.
|
|
|
|
|
|
|
|
## Writing documentation
|
2021-10-27 13:45:37 +02:00
|
|
|
|
|
|
|
Documentation improvements are always welcome.
|
|
|
|
The source for the book is in `book/` and API documentation is generated from the source code.
|
|
|
|
|
|
|
|
## CI test preparation
|
|
|
|
|
|
|
|
Continuous Integration (CI) tests are run against all pull requests.
|
|
|
|
|
|
|
|
Please make sure that tests passes locally before submitting.
|
|
|
|
|
|
|
|
### Cargo format
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> cargo fmt
|
|
|
|
```
|
|
|
|
|
|
|
|
### Example check
|
|
|
|
|
|
|
|
```shell
|
2024-04-04 00:01:46 +02:00
|
|
|
> cargo xtask example-check
|
2021-10-27 13:45:37 +02:00
|
|
|
```
|
|
|
|
|
2024-04-04 00:01:46 +02:00
|
|
|
### Run examples/tests on QEMU device
|
2021-10-27 13:45:37 +02:00
|
|
|
|
|
|
|
```shell
|
2024-04-04 00:01:46 +02:00
|
|
|
> cargo xtask qemu
|
2021-10-27 13:45:37 +02:00
|
|
|
```
|
|
|
|
|
2024-04-04 00:01:46 +02:00
|
|
|
Will execute examples on your local `qemu` install.
|
2021-10-27 13:45:37 +02:00
|
|
|
|
2024-04-04 00:01:46 +02:00
|
|
|
#### Adding examples/tests to xtask
|
2021-10-27 13:45:37 +02:00
|
|
|
|
|
|
|
If you have added further tests, you need to add the expected output in the `ci/expected` folder.
|
|
|
|
|
|
|
|
```shell
|
2024-04-04 00:01:46 +02:00
|
|
|
> cargo xtask qemu --overwrite-expected
|
2021-10-27 13:45:37 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
### Internal tests
|
|
|
|
|
|
|
|
Run internal fail tests locally with:
|
|
|
|
|
|
|
|
```shell
|
2024-04-04 00:01:46 +02:00
|
|
|
> cargo xtask test
|
2021-10-27 13:45:37 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Adding tests to internal tests
|
|
|
|
|
|
|
|
If you have added fail tests or changed the expected behavior, the expected output needs to be updated (corresponding `.stderr` files).
|
|
|
|
Inspect the error output, when sure that `ACTUAL OUTPUT` is correct you can re-run the test as:
|
|
|
|
|
|
|
|
```shell
|
2024-04-04 00:01:46 +02:00
|
|
|
> TRYBUILD=overwrite cargo xtask test
|
2021-10-27 13:45:37 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
This will update the expected output to match the `ACTUAL OUTPUT`.
|
|
|
|
Please check that the updated files are indeed correct to avoid regressions.
|