Skip to content

Commit bd20cdb

Browse files
committed
Add contributing guide
Signed-off-by: Wiktor Kwapisiewicz <[email protected]>
1 parent d78f4e2 commit bd20cdb

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

CONTRIBUTING.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,76 @@
11
# Contributing
22

3+
Thanks for taking the time to contribute to this project!
4+
5+
All changes need to:
6+
7+
- pass basic checks, including tests, formatting and lints,
8+
- be signed-off.
9+
10+
## Basic checks
11+
12+
We are using standard Rust ecosystem tools including `rustfmt` and `clippy` with one minor difference.
13+
Due to a couple of `rustfmt` features being available only in nightly (see the `.rustfmt.toml` file) nightly `rustfmt` is necessary.
14+
15+
All of these details are captured in a `.justfile` and can be checked by running [`just`'](https://just.systems/).
16+
17+
To run all checks locally before sending them to CI you can set your git hooks directory:
18+
319
```sh
420
git config core.hooksPath scripts/hooks/
521
```
22+
23+
## Developer Certificate of Origin
24+
25+
The sign-off is a simple line at the end of the git commit message, which certifies that you wrote it or otherwise have the right to pass it on as a open-source patch.
26+
27+
The rules are pretty simple: if you can [certify the below][DCO]:
28+
29+
```
30+
Developer's Certificate of Origin 1.1
31+
32+
By making a contribution to this project, I certify that:
33+
34+
(a) The contribution was created in whole or in part by me and I
35+
have the right to submit it under the open source license
36+
indicated in the file; or
37+
38+
(b) The contribution is based upon previous work that, to the best
39+
of my knowledge, is covered under an appropriate open source
40+
license and I have the right under that license to submit that
41+
work with modifications, whether created in whole or in part
42+
by me, under the same open source license (unless I am
43+
permitted to submit under a different license), as indicated
44+
in the file; or
45+
46+
(c) The contribution was provided directly to me by some other
47+
person who certified (a), (b) or (c) and I have not modified
48+
it.
49+
50+
(d) I understand and agree that this project and the contribution
51+
are public and that a record of the contribution (including all
52+
personal information I submit with it, including my sign-off) is
53+
maintained indefinitely and may be redistributed consistent with
54+
this project or the open source license(s) involved.
55+
```
56+
57+
then you just add a line saying
58+
59+
Signed-off-by: Random J Developer <[email protected]>
60+
61+
using your name.
62+
63+
If you set your `user.name` and `user.email`, you can sign your commit automatically with [`git commit --signoff`][GSO].
64+
65+
To sign-off your last commit:
66+
67+
git commit --amend --signoff
68+
69+
[DCO]: https://developercertificate.org
70+
[GSO]: https://git-scm.com/docs/git-commit#git-commit---signoff
71+
72+
If you want to fix multiple commits use:
73+
74+
git rebase --signoff main
75+
76+
To check if your commits are correctly signed-off locally use `just check-commits`.

0 commit comments

Comments
 (0)