Merge pull request #4 from NoraCodes/nora/prepush-hook
Add pre-push script for format and clippy
This commit is contained in:
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 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
|
||||
Reference in New Issue
Block a user