summaryrefslogtreecommitdiff
path: root/hooks/pre-commit
blob: 00d361b523ac0bb2baf3e3335ece31fbd3586d96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

./gradlew spotlessCheck -q
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
  echo "❌ spotlessCheck failed, running spotlessApply for you..."

  ./gradlew spotlessApply -q

  echo "Formatting done, please try your commit again! If the problem persists, apply fixes manually."
  exit $EXIT_CODE
fi

exit 0