2024-05-04 17:24:25 +00:00
|
|
|
# Contributing guide
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
This page is for about contributing to conduwuit. The
|
2024-09-06 23:51:06 +00:00
|
|
|
[development](./development.md) page may be of interest for you as well.
|
2024-05-04 17:24:25 +00:00
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
If you would like to work on an [issue][issues] that is not assigned, preferably
|
|
|
|
ask in the Matrix room first at [#conduwuit:puppygock.gay][conduwuit-matrix],
|
|
|
|
and comment on it.
|
2024-05-04 17:24:25 +00:00
|
|
|
|
|
|
|
### Linting and Formatting
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
It is mandatory all your changes satisfy the lints (clippy, rustc, rustdoc, etc)
|
|
|
|
and your code is formatted via the **nightly** `cargo fmt`. A lot of the
|
|
|
|
`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 17:24:25 +00:00
|
|
|
|
2024-08-24 03:13:43 +00: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 17:24:25 +00:00
|
|
|
|
|
|
|
### Running CI tests locally
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
conduwuit's CI for tests, linting, formatting, audit, etc use
|
|
|
|
[`engage`][engage]. engage can be installed from nixpkgs or `cargo install
|
|
|
|
engage`. conduwuit's Nix flake devshell has the nixpkgs engage with `direnv`.
|
|
|
|
Use `engage --help` for more usage details.
|
2024-05-04 17:24:25 +00:00
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
To test, format, lint, etc that CI would do, install engage, allow the `.envrc`
|
|
|
|
file using `direnv allow`, and run `engage`.
|
2024-05-04 17:24:25 +00:00
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
All of the tasks are defined at the [engage.toml][engage.toml] file. You can
|
|
|
|
view all of them neatly by running `engage list`
|
2024-05-04 17:24:25 +00:00
|
|
|
|
|
|
|
If you would like to run only a specific engage task group, use `just`:
|
2024-07-03 07:49:33 +00:00
|
|
|
|
2024-05-04 17:24:25 +00:00
|
|
|
- `engage just <group>`
|
|
|
|
- Example: `engage just lints`
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
If you would like to run a specific engage task in a specific group, use `just
|
|
|
|
<GROUP> [TASK]`: `engage just lints cargo-fmt`
|
2024-05-04 17:24:25 +00:00
|
|
|
|
|
|
|
The following binaries are used in [`engage.toml`][engage.toml]:
|
|
|
|
|
|
|
|
- [`engage`][engage]
|
|
|
|
- `nix`
|
|
|
|
- [`direnv`][direnv]
|
|
|
|
- `rustc`
|
|
|
|
- `cargo`
|
|
|
|
- `cargo-fmt`
|
|
|
|
- `rustdoc`
|
|
|
|
- `cargo-clippy`
|
|
|
|
- [`cargo-audit`][cargo-audit]
|
|
|
|
- [`cargo-deb`][cargo-deb]
|
|
|
|
- [`lychee`][lychee]
|
2024-07-03 07:32:18 +00:00
|
|
|
- [`markdownlint-cli`][markdownlint-cli]
|
2024-07-24 23:34:19 +00:00
|
|
|
- `dpkg`
|
2024-05-04 17:24:25 +00:00
|
|
|
|
|
|
|
### Matrix tests
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
CI runs [Complement][complement], but currently does not fail if results from
|
|
|
|
the checked-in results differ with the new results. If your changes are done to
|
|
|
|
fix Matrix tests, note that in your pull request. If more Complement tests start
|
|
|
|
failing from your changes, please review the logs (they are uploaded as
|
|
|
|
artifacts) and determine if they're intended or not.
|
2024-05-04 17:24:25 +00:00
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
If you'd like to run Complement locally using Nix, see the
|
2024-09-06 23:51:06 +00:00
|
|
|
[testing](development/testing.md) page.
|
2024-05-04 17:24:25 +00:00
|
|
|
|
|
|
|
[Sytest][sytest] support will come soon.
|
|
|
|
|
|
|
|
### Writing documentation
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
conduwuit's website uses [`mdbook`][mdbook] and deployed via CI using GitHub
|
|
|
|
Pages in the [`documentation.yml`][documentation.yml] workflow file with Nix's
|
|
|
|
mdbook in the devshell. All documentation is in the `docs/` directory at the top
|
|
|
|
level. The compiled mdbook website is also uploaded as an artifact.
|
2024-05-04 17:24:25 +00:00
|
|
|
|
|
|
|
To build the documentation using Nix, run: `bin/nix-build-and-cache just .#book`
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
The output of the mdbook generation is in `result/`. mdbooks can be opened in
|
|
|
|
your browser from the individual HTML files without any web server needed.
|
2024-05-09 01:26:05 +00:00
|
|
|
|
2024-05-04 17:24:25 +00:00
|
|
|
### Inclusivity and Diversity
|
|
|
|
|
2024-08-24 03:13:43 +00: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 17:24:25 +00:00
|
|
|
|
2024-08-24 03:13:43 +00: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 17:24:25 +00:00
|
|
|
|
2024-08-24 03:13:43 +00: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 17:24:25 +00:00
|
|
|
|
2024-08-24 03:13:43 +00: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 17:24:25 +00:00
|
|
|
|
|
|
|
### Variable, comment, function, etc standards
|
|
|
|
|
2024-08-24 03:13:43 +00: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 17:24:25 +00:00
|
|
|
|
|
|
|
### Creating pull requests
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
Please try to keep contributions to the GitHub. While the mirrors of conduwuit
|
|
|
|
allow for pull/merge requests, there is no guarantee I will see them in a timely
|
|
|
|
manner. Additionally, please mark WIP or unfinished or incomplete PRs as drafts.
|
|
|
|
This prevents me from having to ping once in a while to double check the status
|
|
|
|
of it, especially when the CI completed successfully and everything so it
|
|
|
|
*looks* done.
|
2024-05-04 17:24:25 +00:00
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
If you open a pull request on one of the mirrors, it is your responsibility to
|
|
|
|
inform me about its existence. In the future I may try to solve this with more
|
|
|
|
repo bots in the conduwuit Matrix room. There is no mailing list or email-patch
|
|
|
|
support on the sr.ht mirror, but if you'd like to email me a git patch you can
|
|
|
|
do so at `strawberry@puppygock.gay`.
|
2024-05-04 17:24:25 +00:00
|
|
|
|
2024-05-05 04:02:34 +00:00
|
|
|
Direct all PRs/MRs to the `main` branch.
|
2024-05-04 17:24:25 +00:00
|
|
|
|
2024-08-24 03:13:43 +00: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
|
2024-09-06 23:51:06 +00:00
|
|
|
in line with the Contributor's Covenant, and conduwuit's Code of Conduct.
|
|
|
|
|
|
|
|
Contribution by users who violate either of these code of conducts will not have
|
2024-11-24 03:35:54 +00:00
|
|
|
their contributions accepted. This includes users who have been banned from
|
|
|
|
conduwuit Matrix rooms for Code of Conduct violations.
|
2024-05-04 17:24:25 +00:00
|
|
|
|
|
|
|
[issues]: https://github.com/girlbossceo/conduwuit/issues
|
|
|
|
[conduwuit-matrix]: https://matrix.to/#/#conduwuit:puppygock.gay
|
|
|
|
[complement]: https://github.com/matrix-org/complement/
|
|
|
|
[engage.toml]: https://github.com/girlbossceo/conduwuit/blob/main/engage.toml
|
|
|
|
[engage]: https://charles.page.computer.surgery/engage/
|
|
|
|
[sytest]: https://github.com/matrix-org/sytest/
|
|
|
|
[cargo-deb]: https://github.com/kornelski/cargo-deb
|
|
|
|
[lychee]: https://github.com/lycheeverse/lychee
|
2024-07-03 07:32:18 +00:00
|
|
|
[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
|
2024-05-04 17:24:25 +00:00
|
|
|
[cargo-audit]: https://github.com/RustSec/rustsec/tree/main/cargo-audit
|
|
|
|
[direnv]: https://direnv.net/
|
|
|
|
[mdbook]: https://rust-lang.github.io/mdBook/
|
|
|
|
[documentation.yml]: https://github.com/girlbossceo/conduwuit/blob/main/.github/workflows/documentation.yml
|