v1.23.0-RC1
Pre-release
Pre-release
1.23.0-RC1 - 2023-04-06
Notable Changes
- This is the first version of detekt that ships with the
detekt-compiler-plugin
. From now on the compiler plugin will follow the same versioning schema as detekt. While still experimental, we invite you to try it and provide feedback till we stabilize it. - #5492 - We added 8 new Rules to detekt
- Notable changes to existing rules:
UnnecessaryAbstractClass
now only runs with type resolution - #5829UnusedPrivateMember
has been refactored with some of its logic moved toUnusedParameter
andUnusedPrivateProperty
- #5722- Removed the
ignoreOverridden
config fromBooleanPropertyNaming
,ConstructorParameterNaming
,FunctionNaming
,VariableNaming
andFunctionParameterNaming
as not useful for those rules - #5718 - Added
ignoredSubjectTypes
to ruleElseCaseInsteadOfExhaustiveWhen
to specify types that should be ignored by the rule (#5623) - #5634 - Added
allowOperators
to ruleDataClassContainsFunctions
- #5658 MandatoryBracesIfStatements
has been removed in favor ofBracesOnIfStatements
- #5700- Added
ignoreWhenContainingVariableDeclaration
toUseIfInsteadOfWhen
to ignore captured variables - #5681
- We added support for Gradle's Worker API inside Detekt Gradle Plugin, for faster execution on bigger projects. - #4128
- We fixed the
includes
/excludes
logic on the config file as they were overriding each other - #5782 - We fully removed support for Spek from
detekt-test-utils
. The recommended testing framework is JUnit - #5785 - The minimum supported Gradle version is now
v6.8.3
- #5616 - This version of detekt is built with Gradle
v8.0.2
, AGP7.4.2
, Kotlin1.8.20
and KtLint0.48.2
(see #5893 #5723 #5877)
Changelog
- Update dependency org.jetbrains:annotations to v24 - #5969
- Update github/codeql-action digest to 8c8d71d - #5966
- Add functions to ExitOutsideMain rule - #5963
- Update README.md - #5954
- Prevent import statements from counting as references for UnusedPrivateProperty - #5942
- Fix ExpressionBodySyntax not checking property getters/setters - #5938
- Improve correctness of UnusedPrivateProperty - #5935
- Fix documentation for deprecated 'reports' object (Issue #5908) - #5924
- Print file path report as link file - #5921
- "detekt" or "Detekt" - #5898
- Update JSON schema URL - #5881
- Add support for local suppression inside formatting - #5876
- Fix checkExhaustiveness for formatting and third party rules - #5869
- Allow newline style for MaxChainedCallsOnSameLine - #5865
- Declare inputs and outputs to support incremental build for testPluginKotlinc - #5862
- Use code syntax for
Unit
for ImplicitUnitReturnType rule - #5857 - MatchingDeclarationName. KtFilesSpec also remove .common.kt suffix from kotlin files - #5851
- Fix double mutability issues with Gradle plugin's use of ConfigurableFileCollection - #5850
- MagicNumber - Make ignoreNamedArgument catch more complex expression - #5837
- Exclude super call when generating guard clauses - #5835
- Enable test retry for all our modules - #5825
- Stop configuring report merge tasks while configuring Detekt tasks - #5813
- FunctionMatcher support for fully qualified function names - #5812
- Boy Scout - #5808
- Simplify
TestConfig
usages - #5801 - Reduce configuration of UnusedPrivateMember's split rules - #5800
- Force SerialVerionUID to be private - #5798
- Exclude the KMP test folders for android - #5797
- Add aliases for PackageNaming and InvalidPackageDeclaration - #5795
- Forbid using Jupiter Kotlin assertions - #5794
- ModifierOrder: fix false positive with block comments - #5791
- Fixed ProtectedMemberInFinalClass rule reporting valid JVM finalize - #5788
- Remove unnecessary usage of BeforeAll in tests - #5781
- Run Kotlin compiler plugin CLI test as part of standard build - #5766
- Refactor to remove java.util.Array* imports - #5761
- Replace java.util.Stack with Kotlin's ArrayDeque implementation - #5760
- Replace java.time.Duration with kotlin.time.Duration - #5759
- Add NixOS installation method to doc - #5757
- Remove & forbid usage of java.util.stream - #5756
- Use stdlib functions for file & path operations - #5754
- Enable UnnecessaryBackticks in detekt project - #5753
- Update docusaurus monorepo to v2.3.1 - #5752
- Resolve runtime classpaths consistently with compile classpaths - #5730
- Exclude new Kotlin Test directories in default config - #5727
- Fail when unexpected version of kotlin-compiler-embeddable is on runtime classpath - #5726
- Fix IgnoredReturnValue rule crash in parallel mode - #5724
- Use
name
that return name after backticks - #5719 - UnusedPrivateMember - Fix false positive in case of invoke operator - #5717
- Fix false positive for
CanBeNonNullable
rule - #5714 - IgnoredReturnValue: fix false negative when annotation is on the package - #5706
- Check Thread.sleep for block expression - #5699
- Fix false positive of in UnnecessaryParentheses - #5684
- Fix url and kotlin reference support in kdoc - #5683
- Add config for variable expression in when - #5681
- Enable NoSemicolons rule - #5663
- Use correct resolvable/consumable flags on detekt's configurations - #5657
- Prepare for Gradle 8 - #5656
- ExplicitCollectionElementAccessMethod rule update - #5654
- Cast nullable to non nullable type - #5653
- Enable verbose mode for Codecov GH Action - #5652
- Fail build when issues found with JVM target compatibility of related compile tasks - #5651
- Don't silently use Kotlin compiler fallback strategy - #5650
- Documentation tweaks - #5639
- Have consistent compile-test-snippets between project and system property - #5630
- Exclude operator functions in function min/max length - #5618
- Broken link at EmptyFunctionBlock - #5604
- Update rule description for errorprone rules - #5603
- FunctionMaxLength false positive for overridden methods #5590 - #5599
- Report proper code position in
MaxLineLength
- #5583 - Allow access to nonpublic members of public types in java.base/java.lang package - #5579
- NonBooleanPropertyPrefixedWithIs: Allow AtomicBoolean - #5577
- Pass compilation output classes to detekt analysis classpath - #5556
- Fix KDocReferencesNonPublicProperty false positive - #5534
Dependency Updates
- Update ktlint to v0.48.1 - #5661
- Update dependency com.android.tools.build:gradle to v7.4.0 - #5693
- JaCoCo 0.8.9 - #5959
- Update dependency com.github.tschuchortdev:kotlin-compile-testing to v1.5.0 - #5882
- Update dependency org.jetbrains.dokka to v1.8.10 - #5878
- Compile detekt-compiler-plugin against standard Kotlin compiler artifact - #5765
- Migrate to SnakeYAML Engine - #5751
- Update kotlin monorepo to v1.8.10 - #5745
- Update ktlint to v0.48.0 - #5625
- Migrate to Gradle Nexus Publish Plugin - #5554
- Update dependency io.github.detekt.sarif4k:sarif4k to v0.2.0 - #5496
Housekeeping & Refactorings
- Fix typo: Github -> GitHub - #5956
- Review all Detekt and Detekt Gradle Plugin usages. - #5955
- Review all Detekt and Detekt Gradle Plugin usages. - #5953
- Add a test for catching undocumented public interfaces - #5951
- Execute tests in parallel - #5944
- Make GeneratorSpec use resources - #5932
- Cleanup detekt-formatting to use detekt's own assertThat function - #5911
- Stale any issue with support tag in one month - #5904
- Remove instances of double mutability - #5899
- Handle todo in LinesOfCode logic - #5897
- Boy scout -
detekt-generator
- #5854 - Tweak GHA configs a bit - #5852
- Create
generateWebsite
- #5849 - Remove dependency between check and jacocoMergedReport - #5846
- Sort deprecation properties - #5845
- Simplify generate documentation - #5844
- Remove unnecessary
@Suppress("ReturnCount")
- #5841 - Cleaner merging of Gradle blocks for functionalTests - #5830
- Replace trimMargin usages - #5827
- Disable PTS from local and enable it for PRs - #5826
- Activate MultilineRawStringIndentation on detekt - #5819
- Remove single-use
times
method, use stdlib'srepeat
instead. - #5774 - Remove redundant build config - #5617
- Migrate to AGP namespaces - #5569
- Fix typo - #5557