v2.0.0-alpha.2Pre-release
2.0.0-alpha.2 - 2026-01-27
This is an alpha release of Detekt 2.0.0. It's built against Kotlin 2.3.0, Gradle 9.3.0, AGP 9.0.0 and is tested against JDK 25.
Please note that in order for this alpha of Detekt to run in an AGP 9.0.0 project, you will need to disable the new DSL and built-in Kotlin by adding these properties to gradle.properties:
android.newDsl=false
android.builtInKotlin=false
Further updates on builtInKotlin support in Detekt Gradle Plugin will be available here.
Notable Changes
- Bump Kotlin to 2.3.0 - #8743
- Bump Gradle to 9.3.0 - #8982
- Bump AGP to 9 - #8553
- Bump minimum AGP to 8.2.2 - #8931
- Enable rules by default that are now standard in ktlint 1.8.0 - #8849
- Bump KtLint to v1.8.0 - #8843
- New ktlint Rule:
ThenSpacingRule- #8850 - New Rule:
UnnecessaryInitOnArray- #8784 - New Rule:
UnnecessaryFullyQualifiedName- #8917
Breaking Changes
- Rename
documentationtocomments- #8889 - Rename
emptytoemptyblocks- #8888 - Rename
bugsrules topotentialbugs- #8887 - Remove
UnnecessaryAnnotationUseSiteTargetrule - #8861 - Rename RuleSet.Id to RuleSetId - #8810
- Rename rule
CommentOverPrivateMethodtoDocumentationOverPrivateMethod- #8778 - Refactor
AbsentOrWrongFileLicense- #8969 - Compile DGP against kotlin-plugin-api only not KGP itself - #8756
- Change configuration options for ForbiddenImport rule - #8747
Changelog
- fix(UnusedImport): detect named companion objects correctly - #9005
- Remove unnecessary tests - #8985
- Pass the correct type to
TestConfig- #8984 - Remove special case for active at
TestConfig- #8983 TestConfigoveryamlConfigFromContent- #8974- Skip underscore placeholders for unused variables on NonNameShadowing rule (#8962) - #8965
- docs: clarify function type handling in ForbiddenMethodCall - #8964
- Check if there suspend function in try block before reporting - #8950
- Fix SubpluginArtifact coordinates for dev.detekt:detekt-compiler-plugin - #8938
- Handle case when inner is required as parent is inner - #8927
- Add paragraph on AI contributed PR - #8922
- Handle case when reference is provided - #8895
- Don't enable rules by default that are only enabled when using ktlint_official code style - #8845
- Filter operations which are terminal as they don't continue sequence - #8804
- Add modality check from analysis api - #8803
- Update
getPropertyAccessorSymbolmethod to correctly return getter … - #8787 - Fix #8160 - Exclude classes in NamedArguments rule - #8782
- remove suppression - #8736
- Remove "V2" from DGP plugin display name and description - #8628
Dependency Updates
- Bump Kotlin to v2.2.21 - #8807
- Bump AGP to 8.13.2 - #8914
- Add transitive assertj dep of assertj core in
detekt-test-assertj- #8923 - chore(deps): update gradle to v9.2.1 - #8868
- fix(deps): update dependency com.android.tools.build:gradle to v8.13.1 - #8838
- chore(deps): update gradle to v9.2.0 - #8820
Housekeeping & Refactorings
- Bump min Node version for website build - #8875
- Enable ValueArgumentComment for detekt project - #8854
Contributors
We would like to thank the following contributors that made this release possible: @3flex, @BraisGabin, @atulgpt, @chao2zhang, @cortinico, @csbiy, @forketyfork, @marschwar, @rschattauer