|
| 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