mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 06:35:48 +03:00
d23d20f31b
Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
14 lines
517 B
Bash
Executable file
14 lines
517 B
Bash
Executable file
#!/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 ktlint &>/dev/null; then
|
|
echo >&2 "Lint failed! See report at file://$(pwd)/app/build/ktlint.txt"
|
|
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
|