mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 03:29:28 +01:00
configure threshold for detekt and solve checking issues
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
87ced6d7bc
commit
b59dffbd6d
@ -23,6 +23,11 @@ apply plugin: 'kotlin-android'
|
|||||||
apply plugin: 'findbugs'
|
apply plugin: 'findbugs'
|
||||||
apply plugin: 'kotlin-kapt'
|
apply plugin: 'kotlin-kapt'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-android-extensions'
|
||||||
|
apply plugin: 'io.gitlab.arturbosch.detekt'
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
ktlint
|
||||||
|
}
|
||||||
|
|
||||||
def taskRequest = getGradle().getStartParameter().getTaskRequests().toString()
|
def taskRequest = getGradle().getStartParameter().getTaskRequests().toString()
|
||||||
if (taskRequest.contains("Gplay") || taskRequest.contains("findbugs") || taskRequest.contains("lint")) {
|
if (taskRequest.contains("Gplay") || taskRequest.contains("findbugs") || taskRequest.contains("lint")) {
|
||||||
@ -172,6 +177,7 @@ dependencies {
|
|||||||
implementation ('com.gitlab.bitfireAT:dav4jvm:f2078bc846', {
|
implementation ('com.gitlab.bitfireAT:dav4jvm:f2078bc846', {
|
||||||
exclude group: 'org.ogce', module: 'xpp3' // Android comes with its own XmlPullParser
|
exclude group: 'org.ogce', module: 'xpp3' // Android comes with its own XmlPullParser
|
||||||
})
|
})
|
||||||
|
ktlint "com.pinterest:ktlint:0.41.0"
|
||||||
implementation 'org.conscrypt:conscrypt-android:2.5.1'
|
implementation 'org.conscrypt:conscrypt-android:2.5.1'
|
||||||
|
|
||||||
|
|
||||||
@ -283,6 +289,30 @@ dependencies {
|
|||||||
findbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.6'
|
findbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.6'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task ktlint(type: JavaExec, group: "verification") {
|
||||||
|
description = "Check Kotlin code style."
|
||||||
|
main = "com.pinterest.ktlint.Main"
|
||||||
|
classpath = configurations.ktlint
|
||||||
|
args "--reporter=plain", "--reporter=plain,output=${buildDir}/ktlint.txt,src/**/*.kt"
|
||||||
|
}
|
||||||
|
|
||||||
|
task ktlintFormat(type: JavaExec, group: "formatting") {
|
||||||
|
description = "Fix Kotlin code style deviations."
|
||||||
|
main = "com.pinterest.ktlint.Main"
|
||||||
|
classpath = configurations.ktlint
|
||||||
|
args "-F", "src/**/*.kt"
|
||||||
|
}
|
||||||
|
|
||||||
|
detekt {
|
||||||
|
reports {
|
||||||
|
xml {
|
||||||
|
enabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
config = files("../detekt.yml")
|
||||||
|
input = files("src/")
|
||||||
|
}
|
||||||
|
|
||||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "1.8"
|
jvmTarget = "1.8"
|
||||||
|
@ -34,6 +34,7 @@ buildscript {
|
|||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
|
||||||
|
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.13.1"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
build:
|
build:
|
||||||
maxIssues: 10
|
maxIssues: 336
|
||||||
weights:
|
weights:
|
||||||
# complexity: 2
|
# complexity: 2
|
||||||
# LongParameterList: 1
|
# LongParameterList: 1
|
||||||
|
Loading…
Reference in New Issue
Block a user