Add pre-push script for format and clippy
This commit is contained in:
parent
ea144a1024
commit
447221ca16
2 changed files with 15 additions and 0 deletions
10
readme.md
10
readme.md
|
|
@ -196,3 +196,13 @@ This pastebin:
|
||||||
- uses server sided highlighting, which ensures that everything stays light and snappy at the client side.
|
- 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.
|
- 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
5
tools/prepush
Executable 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue