Skip to content

Commit 4156e62

Browse files
Add validation of version string to pre-commit hook
1 parent e62c4a1 commit 4156e62

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.githooks/pre-commit

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ EOF
3131
exit 1
3232
fi
3333

34+
if mill show __.publishVersion 2>/dev/null | jq --raw-output '.[]' | \grep -E '[^0-9.]'
35+
then
36+
cat <<\EOF
37+
Error: Version number contains unexpected characters.
38+
39+
Sometimes a 'g' will sneak in there, (see version 0.2g.0), please double-check the publishVersion in build.sc
40+
EOF
41+
exit 1
42+
fi
43+
3444
mill __.compile + \
3545
__.test + \
3646
__.fix --check + \

0 commit comments

Comments
 (0)