|
| 1 | +# Contributing guidelines |
| 2 | + |
| 3 | +## Reporting bugs |
| 4 | + |
| 5 | +If you found a bug, [report it on GitHub](https://github.com/deltachat/deltachat-core-rust/issues). |
| 6 | +If the bug you found is specific to |
| 7 | +[Android](https://github.com/deltachat/deltachat-android/issues), |
| 8 | +[iOS](https://github.com/deltachat/deltachat-ios/issues) or |
| 9 | +[Desktop](https://github.com/deltachat/deltachat-desktop/issues), |
| 10 | +report it to the corresponding repository. |
| 11 | + |
| 12 | +## Proposing features |
| 13 | + |
| 14 | +If you have a feature request, create a new topic on the [forum](https://support.delta.chat/). |
| 15 | + |
| 16 | +## Contributing code |
| 17 | + |
| 18 | +If you want to contribute a code, [open a pull request](https://github.com/deltachat/deltachat-core-rust/pulls). |
| 19 | + |
| 20 | +You can find the list of good first issues |
| 21 | +and a link to this guide |
| 22 | +on the contributing page: <https://github.com/deltachat/deltachat-core-rust/contribute> |
| 23 | + |
| 24 | +### Coding conventions |
| 25 | + |
| 26 | +We format the code using `rustfmt`. Run `cargo fmt` prior to committing the code. |
| 27 | +Run `scripts/clippy.sh` to check the code for common mistakes with [Clippy]. |
| 28 | + |
| 29 | +Commit messages follow the [Conventional Commits] notation. |
| 30 | +We use [git-cliff] to generate the changelog from commit messages before the release. |
| 31 | + |
| 32 | +With **`git cliff --unreleased`**, you can check how the changelog entry for your commit will look. |
| 33 | + |
| 34 | +The following prefix types are used: |
| 35 | +- `feat`: Features, e.g. "feat: Pause IO for BackupProvider". If you are unsure what's the category of your commit, you can often just use `feat`. |
| 36 | +- `fix`: Bug fixes, e.g. "fix: delete `smtp` rows when message sending is cancelled" |
| 37 | +- `api`: API changes, e.g. "api(rust): add `get_msg_read_receipts(context, msg_id)`" |
| 38 | +- `refactor`: Refactorings, e.g. "refactor: iterate over `msg_ids` without `.iter()`" |
| 39 | +- `perf`: Performance improvements, e.g. "perf: improve SQLite performance with `PRAGMA synchronous=normal`" |
| 40 | +- `test`: Test changes and improvements to the testing framework. |
| 41 | +- `build`: Build system and tool configuration changes, e.g. "build(git-cliff): put "ci" commits into "CI" section of changelog" |
| 42 | +- `ci`: CI configuration changes, e.g. "ci: limit artifact retention time for `libdeltachat.a` to 1 day" |
| 43 | +- `docs`: Documentation changes, e.g. "docs: add contributing guidelines" |
| 44 | +- `chore`: miscellaneous tasks, e.g. "chore: add `.DS_Store` to `.gitignore`" |
| 45 | + |
| 46 | +Release preparation commits are marked as "chore(release): prepare for vX.Y.Z". |
| 47 | + |
| 48 | +#### Breaking Changes |
| 49 | + |
| 50 | +Use a `!` to mark breaking changes, e.g. "api!: Remove `dc_chat_can_send`". |
| 51 | + |
| 52 | +Alternatively, breaking changes can go into the commit description, e.g.: |
| 53 | + |
| 54 | +``` |
| 55 | +fix: Fix race condition and db corruption when a message was received during backup |
| 56 | +
|
| 57 | +BREAKING CHANGE: You have to call `dc_stop_io()`/`dc_start_io()` before/after `dc_imex(DC_IMEX_EXPORT_BACKUP)` |
| 58 | +``` |
| 59 | + |
| 60 | +#### Multiple Changes in one PR |
| 61 | + |
| 62 | +If you have multiple changes in one PR, create multiple conventional commits, and then do a rebase merge. Otherwise, you should usually do a squash merge. |
| 63 | + |
| 64 | +[Clippy]: https://doc.rust-lang.org/clippy/ |
| 65 | +[Conventional Commits]: https://www.conventionalcommits.org/ |
| 66 | +[git-cliff]: https://git-cliff.org/ |
| 67 | + |
| 68 | +## Other ways to contribute |
| 69 | + |
| 70 | +For other ways to contribute, refer to the [website](https://delta.chat/en/contribute). |
0 commit comments