Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-push script for format and clippy #4

Merged
merged 1 commit into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 5 additions & 0 deletions tools/prepush
Original file line number Diff line number Diff line change
@@ -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