Skip to content

Commit 0e53f3a

Browse files
committed
Add CONTRIBUTING.md
1 parent 52584f7 commit 0e53f3a

File tree

1 file changed

+151
-0
lines changed

1 file changed

+151
-0
lines changed

CONTRIBUTING.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
Welcome! Thanks for looking into contributing to our project!
2+
3+
# Table of Contents
4+
5+
- [Looking for Help?](#looking-for-help)
6+
- [Documentation](#documentation)
7+
- [Chat Rooms](#chat-rooms)
8+
- [Reporting Issues](#reporting-issues)
9+
- [Submitting Code](#submitting-code)
10+
- [Coding Style](#coding-style)
11+
- [Submitting PRs](#submitting-prs)
12+
- [Where do I start?](#where-do-i-start)
13+
- [Testing](#testing)
14+
- [LLM Contributions](#llm-contributions)
15+
- [Project-related use of LLMs](#project-related-use-of-llms)
16+
17+
# Looking for Help?
18+
19+
Here is a list of helpful resources you can consult:
20+
21+
## Documentation
22+
23+
- [Matrix spec Documentation](https://spec.matrix.org/latest/)
24+
25+
## Chat Rooms
26+
27+
- Ruma Matrix room: [#ruma:matrix.org](https://matrix.to/#/#ruma:matrix.org)
28+
- Ruma Development Matrix room: [#ruma-dev:matrix.org](https://matrix.to/#/#ruma-dev:matrix.org)
29+
- Matrix Developer room: [#matrix-dev:matrix.org](https://matrix.to/#/#matrix-dev:matrix.org)
30+
31+
# Reporting Issues
32+
33+
If you find any bugs, inconsistencies or other problems, feel free to submit
34+
a GitHub [issue](https://github.com/ruma/examples/issues/new).
35+
36+
If you have a quick question, it may be easier to leave a message in
37+
[#ruma:matrix.org](https://matrix.to/#/#ruma:matrix.org).
38+
39+
Also, if you have trouble getting on board, let us know so we can help future
40+
contributors to the project overcome that hurdle too.
41+
42+
# Submitting Code
43+
44+
Ready to write some code? Great! Here are some guidelines to follow to
45+
help you on your way:
46+
47+
## Coding Style
48+
49+
In general, try to replicate the coding style that is already present. Specifically:
50+
51+
### Code Formatting and Linting
52+
53+
We use [rustfmt] to ensure consistent formatting code and [clippy] to catch
54+
common mistakes not caught by the compiler as well as enforcing a few custom
55+
code style choices.
56+
57+
```sh
58+
# if you don't have them installed, install or update the nightly toolchain
59+
rustup install nightly
60+
# … and install prebuilt rustfmt and clippy executables (available for most platforms)
61+
rustup component add rustfmt clippy
62+
```
63+
64+
Before committing your changes, run `cargo +nightly fmt` to format the code (if
65+
your editor / IDE isn't set up to run it automatically) and
66+
`cargo +nightly clippy --workspace`¹ to run lints.
67+
68+
¹ If you modified feature-gated code (`#[cfg(feature = "something")]`), you
69+
have to pass `--all-features` or `--features something` to clippy for it to
70+
check that code
71+
72+
[rustfmt]: https://github.com/rust-lang/rustfmt#readme
73+
[clippy]: https://github.com/rust-lang/rust-clippy#readme
74+
75+
### Import Formatting
76+
77+
Organize your imports into three groups separated by blank lines:
78+
79+
1. `std` imports
80+
1. External imports (from other crates)
81+
1. Local imports (`self::`, `super::`, `crate::` and things like `LocalEnum::*`)
82+
83+
For example,
84+
85+
```rust
86+
use std::collections::BTreeMap;
87+
88+
use ruma_common::api::ruma_api;
89+
90+
use super::MyType;
91+
```
92+
93+
### Commit Messages
94+
95+
The commit message should start with the _area_ that is affected by the change.
96+
An area is usually the name of the affected example. For example, the
97+
description of a commit that affects the hello_world example should look like
98+
"hello-world: Add new event".
99+
100+
Write commit messages using the imperative mood, as if completing the sentence:
101+
"If applied, this commit will \_\_\_." For example, use "Fix some bug" instead
102+
of "Fixed some bug" or "Add a feature" instead of "Added a feature".
103+
104+
(Take a look at this
105+
[blog post](https://www.freecodecamp.org/news/writing-good-commit-messages-a-practical-guide/)
106+
for more information on writing good commit messages.)
107+
108+
## Submitting PRs
109+
110+
Once you're ready to submit your code, create a pull request, and one of our
111+
maintainers will review it. Once your PR has passed review, a maintainer will
112+
merge the request and you're done! 🎉
113+
114+
## Where do I start?
115+
116+
If this is your first contribution to the project, we recommend taking a look
117+
at one of the [open issues][] we've marked for new contributors.
118+
119+
[open issues]: https://github.com/ruma/examples/issues?q=is%3Aissue+is%3Aopen+label%3A"help+wanted"
120+
121+
# Testing
122+
123+
Before committing, run `cargo check` to make sure that your changes can build,
124+
as well as running the formatting and linting tools
125+
[mentioned above](#code-formatting-and-linting).
126+
127+
# LLM Contributions
128+
129+
Contributions must not include content generated by large language models
130+
or other probabilistic tools like ChatGPT, Claude, and Copilot.
131+
132+
This policy exists due to
133+
134+
- ethical concerns about the data gathering for training these models
135+
- the disproportionate use of electricity and water of building / running them
136+
- the potential negative influence of LLM-generated content on quality
137+
- potential copyright violations
138+
139+
This ban of LLM-generated content applies to all parts of the projects,
140+
including, but not limited to, code, documentation, issues, and artworks.
141+
An exception applies for purely translating texts for issues and comments to
142+
English. We may make more exceptions for other accessibility-related uses.
143+
144+
## Project-related use of LLMs
145+
146+
We heavily discourage the use of LLM chat bots as a replacement for reading
147+
Ruma's documentation and API reference.
148+
149+
Support requests referencing misleading or false LLM output relating to the
150+
project may be ignored, since it is a waste of time for us to "debug" where
151+
things went wrong based on this output before human support was sought.

0 commit comments

Comments
 (0)