Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pre-commit « hooks « scripts - github.com/nextcloud/talk-android.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dad2ed4b7c215dd2947780c3660fdb1813b1a7b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
# Pre-commit hook: don't allow commits if detekt or ktlint fail. Skip with "git commit --no-verify".
echo "Running pre-commit checks..."

if ! ./gradlew --daemon ktlintCheck &>/dev/null; then
    echo >&2 "ktlint failed! Run ./gradlew ktlintCheck for details"
    echo >&2 "Hint: fix most lint errors with ./gradlew ktlintFormat"
    exit 1
fi

if ! ./gradlew --daemon detekt &>/dev/null; then
    echo >&2 "Detekt failed! See report at file://$(pwd)/app/build/reports/detekt/detekt.html"
    exit 1
fi