diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..1094618 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,30 @@ +# CONTRIBUTING + +Contributions are welcome, and they are greatly appreciated! + +1. Fork the `phastft` repository +2. Clone your fork to your dev machine/environment: +```bash +git clone git@github.com:/phastft.git +``` +3. [Install Rust](https://www.rust-lang.org/tools/install) and setup [nightly](https://rust-lang.github.io/rustup/concepts/channels.html) Rust + +4. Setup the git hooks by in your local repo: +```bash +cd PhastFT +git config core.hooksPath ./hooks +``` + +5. When you're done with your changes, ensure the tests pass with: +```bash +cargo test --all-features +``` + +7. Commit your changes and push them to GitHub + +8. Submit a pull request (PR) through the [GitHub website](https://github.com/QuState/phastft/pulls). + +## Pull Request Guidelines + +Before you submit a pull request, please check the following: +- The pull request should include tests if it adds and/or changes functionalities. diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 0000000..6d3f529 --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -eu + +if ! cargo fmt --all -- --check +then + echo "There are some code style issues." + echo "Run cargo fmt first." + exit 1 +fi + +if ! cargo clippy -- -D warnings +then + echo "There are some clippy issues." + exit 1 +fi + +if ! cargo test +then + echo "There are some test issues." + exit 1 +fi + +exit 0