Skip to content

Commit

Permalink
feat: zk db check-sqlx-check on pre-push (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomg10 authored Nov 30, 2023
1 parent 89a96af commit 83791aa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# Pre-push hook verifying that inappropriate code will not be pushed.

Expand All @@ -8,7 +8,13 @@ NC='\033[0m' # No Color

# Check that prettier formatting rules are not violated.
if ! zk fmt --check; then
echo -e "${RED}Commit error!${NC}"
echo -e "${RED}Push error!${NC}"
echo "Please format the code via 'zk fmt', cannot push unformatted code"
exit 1
fi

if ! zk db check-sqlx-data; then
echo -e "${RED}Push error!${NC}"
echo "Please update sqlx-data.json via 'zk db setup', cannot push invalid sqlx-data.json file"
exit 1
fi

0 comments on commit 83791aa

Please sign in to comment.