Skip to content

Commit 1637888

Browse files
authored
Merge pull request #250 from carlaKC/contributing-details
docs: Outline preferred commit structure and use of fixups
2 parents 7b6a162 + 61740fd commit 1637888

File tree

3 files changed

+45
-38
lines changed

3 files changed

+45
-38
lines changed

CONTRIBUTING.md

-37
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ sim-cli
5858

5959
Run `sim-cli -h` for details on `--data-dir` and `--sim-file` options that allow specifying custom simulation file locations.
6060

61-
Interested in contributing to the project? See [CONTRIBUTING](CONTRIBUTING.md) for more details.
61+
Interested in contributing to the project? See [CONTRIBUTING](docs/CONTRIBUTING.md) for more details.
6262

6363
### Simulation File Setup
6464
The required access details will depend on the node implementation.

docs/CONTRIBUTING.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Contributing
2+
3+
SimLN is open and welcomes contributions from the community. A good place to start if you have questions is our [discussions forum](https://github.com/bitcoin-dev-project/sim-ln/discussions/123).
4+
5+
## Pull Request (PR) Requirements
6+
7+
The list below contains mandatory checks to be adhered to before a PR can be opened and/or reviewed.
8+
9+
1. [Testing](#testing)
10+
2. [Formating and Linting](#formatting-and-linting)
11+
4. [Commit history](#commit-history)
12+
13+
**Note**: Reviews are contigent on these checks passing locally and in CI.
14+
15+
### Testing
16+
17+
All tests must pass. Do so by running the command
18+
19+
```sh
20+
$ cargo test
21+
```
22+
23+
### Formatting and Linting
24+
25+
Formatting and linting should adhere to the rules specified by default and/or specifically in `rustfmt.toml`. Adhere to the linter suggestions made by `clippy`.
26+
In addition to these check, the recipe `stable-output` ensures consistent and reliable output locally and in CI environment.
27+
28+
```sh
29+
$ make check
30+
```
31+
32+
### Commit history
33+
34+
This project strictly adheres to an [atomic commit structure](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention). This means that:
35+
- Each commit should be a small, coherent logical change described with a [good commit message](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
36+
- Refactors, formatting changes and typo fixes should be in separate commits to logical changes
37+
- Every commit should compile and pass all tests so that we can use [git bisect](https://git-scm.com/docs/git-bisect) for debugging
38+
39+
When your PR is in review, changes should be made using [fixup commits](https://andrewlock.net/smoother-rebases-with-auto-squashing-git-commits/) to maintain the structure of your commits.
40+
When your PR is complete, reviewers will give the instruction to `squash` the fixup commits before merge.
41+
42+
For historical reasons, commit titles in the project are formatted as `<scope>/<type>: commit message`. A list of different commit types is available [here](https://graphite.dev/guides/git-commit-message-best-practices#2-types-of-commits).
43+
44+
For example, a commit that refactors the `sim-cli` package will be titled: `sim-cli/refactor: {message about refactor}`.

0 commit comments

Comments
 (0)