1
0
Fork 0

Upgrade to detekt 1.6.0 (#9306)

Changelog:

https://arturbosch.github.io/detekt/changelog.html

Fixes #7360.  Also use more exact test glob.

Co-authored-by: Andrew Gaul <andrew@gaul.org>
master
Emily Kager 2020-04-01 15:42:46 -07:00 committed by GitHub
parent 8cd6d7460c
commit b94ac93ce9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 10 deletions

View File

@ -18,7 +18,7 @@ buildscript {
}
plugins {
id("io.gitlab.arturbosch.detekt").version("1.0.0-RC16")
id("io.gitlab.arturbosch.detekt").version("1.6.0")
}
allprojects {
@ -48,10 +48,9 @@ task clean(type: Delete) {
detekt {
// The version number is duplicated, please refer to plugins block for more details
version = "1.0.0-RC16"
version = "1.6.0"
input = files("$projectDir/app/src")
config = files("$projectDir/config/detekt.yml")
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
reports {
html {
@ -80,3 +79,9 @@ task ktlint(type: JavaExec, group: "verification") {
main = "com.pinterest.ktlint.Main"
args "app/src/**/*.kt"
}
tasks.withType(io.gitlab.arturbosch.detekt.Detekt.class) {
exclude("**/resources/**")
exclude("**/test/**")
exclude("**/tmp/**")
}

View File

@ -11,7 +11,7 @@ object Versions {
const val leanplum = "5.2.3"
const val osslicenses_plugin = "0.9.5"
const val osslicenses_library = "17.0.0"
const val detekt = "1.0.0-RC16"
const val detekt = "1.6.0"
const val androidx_appcompat = "1.2.0-alpha03"
const val androidx_biometric = "1.0.1"

View File

@ -1,6 +1,3 @@
autoCorrect: true
failFast: false
build:
maxIssues: 0
weights:
@ -27,7 +24,7 @@ console-reports:
# - 'FindingsReport'
# - 'BuildFailureReport'
output-reports:
console-reports:
active: true
exclude:
# - 'HtmlOutputReport'
@ -64,7 +61,7 @@ complexity:
includeStaticDeclarations: false
ComplexMethod:
active: true
threshold: 10
threshold: 15
ignoreSingleWhenExpression: true
LabeledExpression:
active: false
@ -193,6 +190,9 @@ exceptions:
- Throwable
- RuntimeException
formatting:
autoCorrect: true
naming:
active: true
ClassNaming:
@ -219,7 +219,7 @@ naming:
active: true
MemberNameEqualsClassName:
active: false
ignoreOverriddenFunction: true
ignoreOverridden: true
ObjectPropertyNaming:
active: true
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'

View File

@ -4,6 +4,7 @@ import io.gitlab.arturbosch.detekt.api.ConsoleReport
import io.gitlab.arturbosch.detekt.api.Detektion
class CustomRulesetConsoleReport : ConsoleReport() {
@Suppress("DEPRECATION")
override fun render(detektion: Detektion): String? {
return detektion.findings["mozilla-detekt-rules"]?.fold("") { output, finding ->
output + finding.locationAsString + ": " + finding.messageOrDescription()