detekt v2.0.0-alpha.6

v2.0.0-alpha.6Pre-release
Added 5
  • Add ignoreSealedClasses option to AbstractClassCanBeInterface rule
  • Add configuration ignoredFullyQualifiedNames to UnnecessaryFullyQualifiedName rule
  • Expose multiline parameter in ClassSignature
  • Extract interfaces from detekt Gradle tasks
  • Allow setting default autocorrect mode with Gradle property
Changed 5
  • The detekt Gradle task now analyzes all Kotlin source sets with type resolution by default, replacing the previous type-resolution-free task
  • detekt-rules-ktlint-wrapper now targets JVM 17, in preparation for the next ktlint major release which requires JVM 17+
  • Extend PropertyUsedBeforeDeclaration to follow private init calls
  • Recommend to use Locale.ROOT instead of Locale.US
  • Recognize params swallowed by KDoc lexer in OutdatedDocumentation
Fixed 8
  • Fix UnusedPrivateProperty false negative for constructor properties
  • Fix MissingSuperCall false positive when annotation is in grandparent
  • Fix UseDataClass false positive for properties with a custom accessor
  • Fix a potential bug on Config.getListOrDefault
  • Fix UnusedPrivateFunction false positive for overloaded private extension functions with a Java or generated receiver type
  • Fix CanBeNonNullable false negative on local variables
  • Fix CognitiveComplexMethod false positive for object literal methods
  • Fix ReturnCount and ThrowsCount false positive where a guard clause following a local variable declaration was still counted with excludeGuardClauses enabled
2.0.0-alpha.6 - 2026-08-04

This is an alpha release of Detekt 2.0.0. It's built against Kotlin 2.4.10, Gradle 9.6.1, AGP 9.3.1 and is tested against JDK 25.

Notable Changes
  • The detekt Gradle task now analyzes all Kotlin source sets with type resolution by default, replacing the previous type-resolution-free task - #7025
  • detekt-rules-ktlint-wrapper now targets JVM 17, in preparation for the next ktlint major release which requires JVM 17+, the rest of detekt still targets JVM 8+ - #9453
Changelog
  • feat(rules): add ignoreSealedClasses option to AbstractClassCanBeInterface - #9557
  • docs: drop stale Android compile classpath warning note - #9550
  • Recommend to use Locale.ROOT instead of Locale.US - #9532
  • Recognize params swallowed by KDoc lexer in OutdatedDocumentation - #9529
  • Fix UnusedPrivateProperty false negative for constructor properties - #9491
  • Fix MissingSuperCall false positive when annotation is in grandparent - #9469
  • Fix UseDataClass false positive for properties with a custom accessor - #9462
  • Fix a potential bug on Config.getListOrDefault - #9461
  • Fix UnusedPrivateFunction false positive for overloaded private extension functions with a Java (or generated) receiver type - #9450
  • Fix CanBeNonNullable false negative on local variables - #9432
  • Fix CognitiveComplexMethod false positive for object literal methods - #9431
  • Fix ReturnCount/ThrowsCount false positive where a guard clause following a local variable declaration was still counted (with excludeGuardClauses enabled) - #9424
  • Extend PropertyUsedBeforeDeclaration to follow private init calls - #9334
  • Add configuration ignoredFullyQualifiedNames to UnnecessaryFullyQualifiedName rule - #9301
  • Expose multiline parameter in ClassSignature - #9084
  • Extract interfaces from detekt Gradle tasks - #7662
  • Allow setting default autocorrect mode with Gradle property - #7040
Dependency Updates
  • Update agp to v9.3.1 - #9538
  • Update kotlin monorepo to v2.4.10 - #9518
  • Update Gradle to v9.6.1 - #9444
  • Update Gradle to v9.6.0 - #9420
Housekeeping & Refactorings
  • Reduce scope of @Suppress("UNCHECKED_CAST") - #9459
  • Remove irrelevant test for YamlConfig - #9457
  • fix: handle trailing commas in @Configuration annotation parsing in JS generator - #9447
  • Production code should not depend on fixtures - #9439
Contributors

We would like to thank the following contributors that made this release possible: @3flex, @BraisGabin, @ChristophyBarth, @FilippoVigani, @Phoenix1808, @ShubhamWorks02, @cortinico, @e5l, @eyupcanakman, @iuryeng, @loganrosen, @marpalat, @roian6, @sahilpatel2521, @tonytonycoder11

See all issues at: 2.0.0

View original

Upgraded? How did it go?

Discussion