aboutsummaryrefslogtreecommitdiff
path: root/scripts/pre-push-hook.sh
blob: dea8cedb4dc555130a90906bcd4de23afd3cd03b (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

set -e
set -u
set -o pipefail

ZERO="0000000000000000000000000000000000000000"
GRADLE_EXEC="${GRADLE_EXEC:-./gradlew}"

while read -r local_ref local_oid remote_ref remote_oid; do
  # These useless assignments are to silence warnings from shellcheck about unused variables
  _=$local_ref
  _=$remote_ref
  _=$remote_oid
  if [ "${local_oid}" != "${ZERO}" ]; then
    "${GRADLE_EXEC}" metalavaCheckCompatibilityRelease lint ktfmtCheck test -PslimTests
  fi
done