-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add git hooks and contributing guide
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |