mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 13:15:35 +03:00
a619cdbef8
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
19 lines
740 B
Bash
Executable file
19 lines
740 B
Bash
Executable file
#!/bin/bash
|
|
# Pre-commit hook: don't allow commits if detekt or ktlint fail. Skip with "git commit --no-verify".
|
|
|
|
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
|
|
# SPDX-FileCopyrightText: 2021 Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
echo "Running pre-commit checks..."
|
|
|
|
if ! ./gradlew --daemon spotlessKotlinCheck &>/dev/null; then
|
|
echo >&2 "ktlint failed! Run ./gradlew spotlessKotlinCheck for details"
|
|
echo >&2 "Hint: fix most lint errors with ./gradlew spotlessKotlinApply"
|
|
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
|