Skip to content

Commit fbd65dd

Browse files
committed
githooks
1 parent 9bcd822 commit fbd65dd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.githooks/pre-commit

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
3+
set -euo pipefail
4+
IFS=$'\n\t'
5+
6+
if ! ./gradlew spotlessCheck; then
7+
./gradlew spotlessApply
8+
echo ""
9+
echo ""
10+
echo -e "\033[0;33mCode has been formatted; please git diff/add and recommit."
11+
echo ""
12+
echo ""
13+
exit 1
14+
fi
15+
16+
# Run Groovy code check
17+
./gradlew codenarcTest -PskipTests

0 commit comments

Comments
 (0)