Thank you for considering contributing to git-cliff!
When contributing, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Note that we have a Code of Conduct, please follow it in all your interactions with the project.
- Install the nightly toolchain (required for
rustfmt):
rustup toolchain install nightly- Optional: set up editor/IDE integration to use nightly
rustfmtfor this repository.
-
Fork this repository and create your branch from
main. -
Clone your forked repository.
git clone https://github.com/{username}/git-cliff && cd git-cliff
# OR
git clone git@github.com:{username}/git-cliff && cd git-cliff- Fetch tags (required for tests):
git fetch --tags https://github.com/orhun/git-cliff- Install Rust
1.85.1or later and build the project:
cargo buildNote
- The project uses stable Rust for builds and tests.
- Formatting and linting are run with the nightly toolchain in CI due to the use of unstable
rustfmtoptions. Contributors are expected to run the same checks locally.
-
Start committing your changes. Follow the Conventional Commits specification.
-
Add your tests (if you haven't already) or update the existing tests according to the changes. And check if the tests are passed:
cargo test- If you changed snapshot tests (i.e.
expect_test), update snapshots:
env UPDATE_EXPECT=1 cargo test- Run CI checks locally -
clippy(warnings are errors)
cargo clippy --tests --verbose -- -D warnings- Run formatting checks –
rustfmt
cargo +nightly fmt --all -- --check --verboseIf formatting fails, please run:
cargo +nightly fmt --all-
Ensure that you updated the documentation and filled the Pull Request template according to the changes you made.
-
Wait for approval from the project owner/maintainer. Discuss the possible changes and update your Pull Request if necessary.
-
You may merge the Pull Request once you have the sign-off of the project owner/maintainer, or if you do not have permission to do that, you may request the project owner/maintainer to merge it in case they haven't done it after a while.
By contributing, you agree that your contributions will be licensed under The MIT License or Apache License 2.0.