https://kotlinlang.org logo
#detekt
Title
# detekt
e

Endre Deak

10/08/2021, 6:30 PM
Hi, I’m having trouble making detect autoformat too long lines. Here’s my config:
Copy code
build:
  maxIssues: 0
  excludeCorrectable: false

config:
  validation: true
  warningsAsErrors: false

processors:
  active: true

comments:
  active: true
  UndocumentedPublicClass:
    active: true
    excludes: [ '**/test/**', '**/integrationTest/**', '**/systemTest/**', '*Test' ]
    searchInNestedClass: true
    searchInInnerClass: true
    searchInInnerObject: true
    searchInInnerInterface: true
  UndocumentedPublicFunction:
    active: true
    excludes: [ '**/test/**', '**/integrationTest/**', '**/systemTest/**', '*Test' ]
  UndocumentedPublicProperty:
    active: true
    excludes: [ '**/test/**', '**/integrationTest/**', '**/systemTest/**', '*Test' ]

formatting:
  active: true
  autoCorrect: true
  MaximumLineLength:
    active: true
    autoCorrect: true
    maxLineLength: 120
    ignoreBackTickedIdentifier: true
configuration:
Copy code
detekt {
    toolVersion = "1.18.1"
    config = files("config/detekt/detekt.yml")
    buildUponDefaultConfig = true
    autoCorrect = true
    debug = true
}
I have a line longer than 120 chars and doesn’t get formatted correctly when I run
gradle detekt
. What do I miss here?
c

chao

10/08/2021, 6:31 PM
e

Endre Deak

10/08/2021, 6:37 PM
I did:
Copy code
dependencies {
    ...
        detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.18.1")
    ...
}
also if I turn on debug, I cannot see any failed attempt on trying to run autocorrect (and fail)
c

chao

10/08/2021, 7:56 PM
Line 88 -
emit(offset, "Exceeded max line length ($maxLineLength)", false)
, the false is for
canBeAutoCorrected
e

Endre Deak

10/08/2021, 8:14 PM
ohh
damn
thanks for digging into this!
236 Views