-
Notifications
You must be signed in to change notification settings - Fork 5
/
detekt-config.gradle
43 lines (36 loc) · 942 Bytes
/
detekt-config.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
apply plugin: "io.gitlab.arturbosch.detekt"
detekt {
failFast = true
buildUponDefaultConfig = true
autoCorrect = true
reports {
html.enabled = true
xml.enabled = true
txt.enabled = true
}
}
dependencies {
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$detekt_version"
}
tasks.detekt.jvmTarget = "11"
/***
*
* ADD THIS TO <<your-repo>>/.git/hooks/pre-commit
* DON'T FORGET TO MAKE IT EXECUTABLE WITH chmod +x pre-commit
*
#!/usr/bin/env bash
echo "Running detekt check..."
OUTPUT="/tmp/detekt-$(date +%s)"
./gradlew detekt > $OUTPUT
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
cat $OUTPUT
rm $OUTPUT
echo "***********************************************"
echo " Detekt failed "
echo " Please fix the above issues before committing "
echo "***********************************************"
exit $EXIT_CODE
fi
rm $OUTPUT
***/