repo created
This commit is contained in:
commit
93184d21d1
1403 changed files with 189511 additions and 0 deletions
19
scripts/hooks/pre-commit
Executable file
19
scripts/hooks/pre-commit
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/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: GPL-3.0-or-later
|
||||
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue