2024-05-04 13:24:25 -04:00
# Contributing guide
2025-06-23 01:04:27 +01:00
This page is about contributing to Continuwuity. The
2024-09-06 19:51:06 -04:00
[development ](./development.md ) page may be of interest for you as well.
2024-05-04 13:24:25 -04:00
2024-08-24 05:13:43 +02:00
If you would like to work on an [issue][issues] that is not assigned, preferably
2025-04-27 18:42:02 +00:00
ask in the Matrix room first at [#continuwuity:continuwuity .org][continuwuity-matrix],
2024-08-24 05:13:43 +02:00
and comment on it.
2024-05-04 13:24:25 -04:00
### Linting and Formatting
2024-08-24 05:13:43 +02:00
It is mandatory all your changes satisfy the lints (clippy, rustc, rustdoc, etc)
2025-06-23 01:04:27 +01:00
and your code is formatted via the **nightly** rustfmt (`cargo +nightly fmt` ). A lot of the
2024-08-24 05:13:43 +02:00
`rustfmt.toml` features depend on nightly toolchain. It would be ideal if they
weren't nightly-exclusive features, but they currently still are. CI's rustfmt
uses nightly.
2024-05-04 13:24:25 -04:00
2024-08-24 05:13:43 +02:00
If you need to allow a lint, please make sure it's either obvious as to why
(e.g. clippy saying redundant clone but it's actually required) or it has a
comment saying why. Do not write inefficient code for the sake of satisfying
lints. If a lint is wrong and provides a more inefficient solution or
suggestion, allow the lint and mention that in a comment.
2024-05-04 13:24:25 -04:00
2025-06-23 01:04:27 +01:00
### Running tests locally
2024-05-04 13:24:25 -04:00
2025-06-23 01:04:27 +01:00
Tests, compilation, and linting can be run with standard Cargo commands:
2024-05-04 13:24:25 -04:00
2025-06-23 01:04:27 +01:00
```bash
# Run tests
cargo test
2024-05-04 13:24:25 -04:00
2025-06-23 01:04:27 +01:00
# Check compilation
cargo check --workspace
2024-05-04 13:24:25 -04:00
2025-06-23 01:04:27 +01:00
# Run lints
cargo clippy --workspace
# Auto-fix: cargo clippy --workspace --fix --allow-staged;
2024-07-03 03:49:33 -04:00
2025-06-23 01:04:27 +01:00
# Format code (must use nightly)
cargo +nightly fmt
```
2024-05-04 13:24:25 -04:00
### Matrix tests
2025-06-23 01:04:27 +01:00
Continuwuity uses [Complement][complement] for Matrix protocol compliance testing. Complement tests are run manually by developers, and documentation on how to run these tests locally is currently being developed.
2024-05-04 13:24:25 -04:00
2025-06-23 01:04:27 +01:00
If your changes are done to fix Matrix tests, please note that in your pull request. If more Complement tests start failing from your changes, please review the logs and determine if they're intended or not.
2024-05-04 13:24:25 -04:00
2025-06-23 01:04:27 +01:00
[Sytest][sytest] is currently unsupported.
2024-05-04 13:24:25 -04:00
### Writing documentation
2025-06-23 01:04:27 +01:00
Continuwuity's website uses [`mdbook` ][mdbook] and is deployed via CI using Cloudflare Pages
in the [`documentation.yml` ][documentation.yml] workflow file. All documentation is in the `docs/`
directory at the top level.
To build the documentation locally:
1. Install mdbook if you don't have it already:
```bash
cargo install mdbook # or cargo binstall, or another method
```
2024-05-04 13:24:25 -04:00
2025-06-23 01:04:27 +01:00
2. Build the documentation:
```bash
mdbook build
```
2024-05-04 13:24:25 -04:00
2025-06-23 01:04:27 +01:00
The output of the mdbook generation is in `public/` . You can open the HTML files directly in your browser without needing a web server.
2024-05-08 21:26:05 -04:00
2024-05-04 13:24:25 -04:00
### Inclusivity and Diversity
2024-08-24 05:13:43 +02:00
All **MUST** code and write with inclusivity and diversity in mind. See the
[following page by Google on writing inclusive code and
documentation](https://developers.google.com/style/inclusive-documentation).
2024-05-04 13:24:25 -04:00
2024-08-24 05:13:43 +02:00
This **EXPLICITLY** forbids usage of terms like "blacklist"/"whitelist" and
"master"/"slave", [forbids gender-specific words and
phrases](https://developers.google.com/style/pronouns#gender -neutral-pronouns),
forbids ableist language like "sanity-check", "cripple", or "insane", and
forbids culture-specific language (e.g. US-only holidays or cultures).
2024-05-04 13:24:25 -04:00
2024-08-24 05:13:43 +02:00
No exceptions are allowed. Dependencies that may use these terms are allowed but
[do not replicate the name in your functions or
variables](https://developers.google.com/style/inclusive-documentation#write -around).
2024-05-04 13:24:25 -04:00
2024-08-24 05:13:43 +02:00
In addition to language, write and code with the user experience in mind. This
is software that intends to be used by everyone, so make it easy and comfortable
for everyone to use. 🏳️⚧️
2024-05-04 13:24:25 -04:00
### Variable, comment, function, etc standards
2024-08-24 05:13:43 +02:00
Rust's default style and standards with regards to [function names, variable
names, comments](https://rust-lang.github.io/api-guidelines/naming.html), etc
applies here.
2024-05-04 13:24:25 -04:00
### Creating pull requests
2025-04-27 18:42:02 +00:00
Please try to keep contributions to the Forgejo Instance. While the mirrors of continuwuity
allow for pull/merge requests, there is no guarantee the maintainers will see them in a timely
2024-08-24 05:13:43 +02:00
manner. Additionally, please mark WIP or unfinished or incomplete PRs as drafts.
2025-04-27 18:42:02 +00:00
This prevents us from having to ping once in a while to double check the status
2024-08-24 05:13:43 +02:00
of it, especially when the CI completed successfully and everything so it
*looks* done.
2024-05-04 13:24:25 -04:00
2024-05-05 00:02:34 -04:00
Direct all PRs/MRs to the `main` branch.
2024-05-04 13:24:25 -04:00
2024-08-24 05:13:43 +02:00
By sending a pull request or patch, you are agreeing that your changes are
allowed to be licenced under the Apache-2.0 licence and all of your conduct is
2025-04-27 18:42:02 +00:00
in line with the Contributor's Covenant, and continuwuity's Code of Conduct.
2024-09-06 19:51:06 -04:00
2025-06-23 01:25:38 +01:00
Contribution by users who violate either of these code of conducts may not have
2024-11-23 22:35:54 -05:00
their contributions accepted. This includes users who have been banned from
2025-06-23 01:25:38 +01:00
continuwuity Matrix rooms for Code of Conduct violations.
2024-05-04 13:24:25 -04:00
2025-04-27 18:42:02 +00:00
[issues]: https://forgejo.ellis.link/continuwuation/continuwuity/issues
[continuwuity-matrix]: https://matrix.to/#/#continuwuity:continuwuity .org
2024-05-04 13:24:25 -04:00
[complement]: https://github.com/matrix-org/complement/
[sytest]: https://github.com/matrix-org/sytest/
[mdbook]: https://rust-lang.github.io/mdBook/
2025-04-27 18:42:02 +00:00
[documentation.yml]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/.forgejo/workflows/documentation.yml