Add pre-push script for format and clippy

This commit is contained in:
Leonora Tindall
2022-02-02 12:56:41 -06:00
parent ea144a1024
commit 447221ca16
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