Skip to content

Commit

Permalink
Add git hooks and contributing guide
Browse files Browse the repository at this point in the history
  • Loading branch information
smu160 committed Jun 10, 2024
1 parent 7e8176a commit 274f570
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
30 changes: 30 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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:<username>/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.
24 changes: 24 additions & 0 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 274f570

Please sign in to comment.