Merge pull request #4 from NoraCodes/nora/prepush-hook

Add pre-push script for format and clippy
This commit is contained in:
Gunwant Jain
2022-02-03 00:29:50 +05:30
committed by GitHub
2 changed files with 15 additions and 0 deletions

View File

@@ -196,3 +196,13 @@ This pastebin:
- uses server sided highlighting, which ensures that everything stays light and snappy at the client side.
- uses very minimal frontend because a pastebin does not need it. It focuses (or atleast tries to) on getting things done in minimum amount of clicks.
## Hacking
If you want to ensure your pushed refs will pass CI, add the prepush script to your Git hooks:
```bash
$ cat tools/prepush >> .git/hooks/pre-push
```
Alternately, just run `./tools/prepush` yourself before pushing.

5
tools/prepush Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
echo "[prepush] Running cargo fmt --check"
cargo fmt -- --check
echo "[prepush] Running cargo clippy"
cargo clippy -- -Dwarnings