Skip to content

Releases: detekt/detekt

v1.7.1

26 Mar 16:52
34ccbc4
Compare
Choose a tag to compare
Changelog
  • UnnecessaryAbstractClass: fix false positive when abstract class has abstract inherited members - #2513
  • UnusedPrivateMember: report unused overloaded operators - #2510
  • Fix build compile error resulted from merging two conflicting PRs - #2508
  • Update Kotlin to 1.3.71 - #2507
  • Remove duplicated test task setup for gradle plugin - #2506
  • Add LicenceHeaderExtension test to verify resource path loading is supported - #2505
  • Ensure filesystems are created so paths can be gotten - #2504
  • FileSystemNotFoundException in detekt 1.7.0 when using --config-resource - #2503
  • MemberNameEqualsClassName: fix false negative when function has no explicit return type - #2502
  • Use the system-dependent line separator in NotificationReport - #2497
  • Remove default print stream - #2496
  • Don't use System.out in the ProgressListeners - #2495
  • Make the gradle plugin a sub project again - #2493
  • Move test factory outside the main code - #2491
  • Single runner - #2490
  • ProcessingSettings - #2489
  • Don't use println :detekt-generator - #2488
  • Simplify tests with StringPrintStream - #2487
  • Improve tests - #2486
  • Use PrinterStream in AstPrinter - #2485
  • Errors running detekt in the detekt project - #2484
  • Unify yml strings - #2482
  • Use yml arrays to list the ForbiddenImports - #2474
  • Add date, detekt-version + link to HtmlReport - #2470
  • Refactor FindingsReport + FileBasedFindingsReport - #2454
  • The Detekt HTML Report should include date, version number, website link (Feature Request) - #2416
  • Added validation of constructors to LongParameterList - #2410
  • UnusedPrivateMember doesn't report the correct warning count - #1981
  • UnusedPrivateMember should consider overloaded operators - #1444
  • False positive on rule UnnecessaryAbstractClass - #727
  • MemberNameEqualsClassName ignores functions which return a single expression - #655

See all issues at: 1.7.1

1.7.0

22 Mar 12:17
1870d0b
Compare
Choose a tag to compare
Notable Changes
  • The Gradle plugin should be on par with the CLI performance-wise
  • Good to know: detekt CLI always supported argument files (java -jar detekt-cli.jar @argsfile)
  • New CLI --version flag
  • New Rule AbsentOrWrongFileLicense and other rule improvements
Changelog
  • Update Travis to use the newest xcode11.3 image - #2480
  • Synchronize use of root extension point - #2479
  • Extend ComplexInterface to support exclusion of private member/functions - #2478
  • Minor refactors around --create-baseline - #2477
  • Check primary ctor in UndocumentedPublicProperty - #2475
  • Unify yaml strings - #2472
  • Running detektBaseline generates too general exceptions, disabling rules - #2471
  • UndocumentedPublicProperty doesn't check primary constructor - #2468
  • Remove default implementations of toString() - #2467
  • Remove tags from core documentation sites - #2466
  • Validate boolean config values - Closes #2045 - #2465
  • Add test for BaselineHandler - #2462
  • Refactor BaselineFormatSpec.kt - #2461
  • Add tests for BaselineFacade - #2460
  • Fix toString() output for Whitelist class - #2459
  • Remove unused functions in XmlExtensions.kt - #2458
  • Add test cases for invalid yaml config - #2457
  • Add edge test cases for ComplexityReportGenerator - #2456
  • Simplify anonymous Detektion object creation - #2455
  • Update trim logic in Debt:toString() - #2453
  • Refactor FindingsReport + FileBasedFindingsReport - #2451
  • Rename tests with _Test prefix to _Spec - #2450
  • Refactor HtmlOutputReport - #2449
  • Simplify UnnecessaryApplySpec test cases - #2448
  • Link code samples package for extension guide - #2447
  • ComplexInterface - should it also count private methods? - #2446
  • Update AppVeyor branch conf to comply with Travis - #2445
  • Add PsiViewer plugin to Contributing guide - #2444
  • UnnecessaryApply: fix false positive when it's used as an expression - #2442
  • Add detekt-hint to integrations - #2441
  • SwallowedException: fix false negative when using variables - #2436
  • UnnecessaryApply false positive cases - #2435
  • Prepare 1.7.0-beta2 release - #2434
  • Parallel invocation of DetektFacade fails spuriously - #2433
  • Deprecate BaseRule and state that it will be make sealed - #2365 - #2432
  • Add License rule - #2429
  • Skip all guard clauses at function start for ReturnCount - Closes #2342 - #2428
  • Fail if --baseline file not found - #2427
  • Add tests for YamlConfig - #2426
  • Choose a minimum codecov patch coverage ratio - #2425
  • Include ruleset-suppression feature doc - #2424
  • Add Groovy DSL example for jvmTarget to homepage - #2423
  • Add groovy dsl example for jvmTarget - Closes #2408 - #2422
  • Deprecate hierarchical config - #2421
  • Deprecate implementations of Config - #2420
  • Remove YAML Extension Requirement - #2419
  • Update Spek version to 2.0.10 - #2418
  • file does not end with .yml! - #2417
  • Disable autoCorrect property for all rules if global flag is set to false - #2413
  • Release 1.7.0 beta - #2409
  • Stop using kotlin-reflect - #2405
  • Stop compiling with experimental flag - #2404
  • Only post a code coverage patch status to PRs - #2402
  • ExplicitCollectionElementAccessMethod: Don't report on nullable collection - #2401
  • Discourage new Case files - #2399
  • Use argsfiles for CI - #2397
  • Update to Kotlin v1.3.70 - #2396
  • Fix typo in VersionPrinter test - #2395
  • Add documentation for cli --version flag - #2392
  • ExplicitCollectionElementAccessMethod: Do not report map?.get("foo") - #2391
  • Update Gradle to 6.2.1 - #2390
  • Do not report conditional elvis continue statements - Closes#2388 - #2389
  • False positive: UnconditionalJumpStatementInLoop with elvis operator ?: - #2388
  • Refactor getting the detekt version for readability - #2387
  • Create less objects and sets when creating findings id map - #2385
  • Add --version to cli - #2383
  • Add --version CLI option - #2382
  • Add test cases for cli/runners package - #2381
  • Sort and run correctable rules first - #2341 - #2378
  • Should fail if --baseline file does not found? - #2374
  • Deprecate rule set methods which expose implementation details of detekt-core - #2366
  • Deprecate api's exposing detekt-core implementation details - #2365
  • ReturnCount excludeGuardClauses not working - #2342
  • Mixing autocorrectable and non correctable rules results in obsolete issue locations for reports - #2341
  • Allow Detekt CLI to take an args file. - #2318
  • Homepage doesn't show Jekyll tags correctly - #2309
  • Call detekt reflectively - #2282
  • Copyright header rule for Kotlin files - #1515 - #2077
  • SwallowedException false negative - #2049
  • Invalid boolean config values are evaluated silently to false - #2045
  • Detekt gradle is much slower than the jar - #2035
  • Cases files are super rigorous to work with - #1089

See all issues at: 1.7.0

1.7.0-beta2

15 Mar 19:58
90d426a
Compare
Choose a tag to compare
1.7.0-beta2 Pre-release
Pre-release
Notable Changes
  • The Gradle plugin should be on par with the CLI performance-wise
  • Good to know: detekt CLI always supported argument files (java -jar detekt-cli.jar @argsfile)
  • New CLI --version flag
  • New Rule AbsentOrWrongFileLicense and other rule improvements
Changelog
  • Deprecate BaseRule and state that it will be make sealed - #2365 - #2432
  • Add License rule - #2429
  • Skip all guard clauses at function start for ReturnCount - Closes #2342 - #2428
  • Fail if --baseline file not found - #2427
  • Add tests for YamlConfig - #2426
  • Choose a minimum codecov patch coverage ratio - #2425
  • Include ruleset-suppression feature doc - #2424
  • Add Groovy DSL example for jvmTarget to homepage - #2423
  • Add groovy dsl example for jvmTarget - Closes #2408 - #2422
  • Deprecate hierarchical config - #2421
  • Deprecate implementations of Config - #2420
  • Remove YAML Extension Requirement - #2419
  • Update Spek version to 2.0.10 - #2418
  • file does not end with .yml! - #2417
  • Disable autoCorrect property for all rules if global flag is set to false - #2413
  • Release 1.7.0 beta - #2409
  • Stop using kotlin-reflect - #2405
  • Stop compiling with experimental flag - #2404
  • Only post a code coverage patch status to PRs - #2402
  • ExplicitCollectionElementAccessMethod: Don't report on nullable collection - #2401
  • Discourage new Case files - #2399
  • Use argsfiles for CI - #2397
  • Update to Kotlin v1.3.70 - #2396
  • Fix typo in VersionPrinter test - #2395
  • Add documentation for cli --version flag - #2392
  • ExplicitCollectionElementAccessMethod: Do not report map?.get("foo") - #2391
  • Update Gradle to 6.2.1 - #2390
  • Do not report conditional elvis continue statements - Closes#2388 - #2389
  • False positive: UnconditionalJumpStatementInLoop with elvis operator ?: - #2388
  • Refactor getting the detekt version for readability - #2387
  • Create less objects and sets when creating findings id map - #2385
  • Add --version to cli - #2383
  • Add --version CLI option - #2382
  • Add test cases for cli/runners package - #2381
  • Sort and run correctable rules first - #2341 - #2378
  • Should fail if --baseline file does not found? - #2374
  • Deprecate rule set methods which expose implementation details of detekt-core - #2366
  • Deprecate api's exposing detekt-core implementation details - #2365
  • ReturnCount excludeGuardClauses not working - #2342
  • Mixing autocorrectable and non correctable rules results in obsolete issue locations for reports - #2341
  • Allow Detekt CLI to take an args file. - #2318
  • Call detekt reflectively - #2282
  • Copyright header rule for Kotlin files - #1515 - #2077
  • Detekt gradle is much slower than the jar - #2035
  • Cases files are super rigorous to work with - #1089

See all issues at: 1.7.0

1.6.0

26 Feb 22:36
b86dd1e
Compare
Choose a tag to compare
Migration

Rule set authors do not need to exclude their rule set from config validation anymore.
This will be done by default now.

If you need to include further config property checks, give the new ConfigValidator api a try.

Changelog
  • Check-in ConfigValidator documentation - #2368
  • Remove obsolete PathFilter class - #2367
  • Reference coroutines doc for homepage - #2363
  • [Documentation Request] Coroutine Ruleset - #2362
  • Extend AnnotationExcluder to catch fully qualified annotations - #2361
  • UnnecessaryAbstractClass excludeAnnotatedClasses not working - #2360
  • Replace LinkedList with ArrayDeque - #2358
  • Fix detection of CRLF line endings - #2357
  • Introduce new ConfigValidator extensions - #2285 - #2356
  • Include options to better meet requirements for utility files - #2355
  • Don't normalize file content twice - #2354
  • Remove unused code in rules/Case.kt - #2351
  • Add blog post about speeding up a detekt task - #2349
  • Add tests for setting KtLint's config - #2348
  • add details into internal validation - #2347
  • Minor change in the HTML report: Remove extra space when you copy the file path - #2344
  • detekt does not always inject the required EDITOR_CONFIG_USER_DATA_KEY for ktlint - #2339
  • Remove duplicate tests for TooManyFunctions rule - #2338
  • Add EmptyTryBlock rule - #2337
  • Use requireNotNull for arguments checking - #2336
  • Refactor and add tests to Ast- and ElementPrinter - #2335
  • Add test case for disabled reports - #2334
  • Refactor ReportPath:load() - #2333
  • Add test case for FileProcessorLocator - #2332
  • Add test cases for Kt(Tree)Compiler - #2331
  • Add equality test cases for PathFiler - #2330
  • Add local function test case for MethodOverloading rule - #2328
  • Add anonymous object expression test case for MethodOverloading rule - #2327
  • Validate Gradle Wrapper - #2326
  • Use more consistent metrics in HtmlReport - #2325
  • Fix ClassCastException in ExplicitCollectionElementAccessMethod - #2323
  • ExplicitCollectionElementAccessMethod crashes - #2322
  • use same behaviour for valueOrNull as for valueOrDefault - #2319
  • FailFastConfig.valueOrNull should return specified value for active and maxIssues - #2316
  • Bugfix: MagicNumber with ignoreNamedArgument and a negative value - #2315
  • More consistent reports - #2291
  • Change MatchingDeclarationName to handle utility files - #1500
  • False-positive MagicNumber issue reported when using negative numbers - #530

See all issues at: 1.6.0

1.5.1

06 Feb 20:59
b190e11
Compare
Choose a tag to compare
  • Update intro page to deprecate input property - #2311
  • Update codecov run settings to after_n_builds=4 - #2305
  • Update GroovyDSL doc to deprecate input property - #2304
  • Update KotlinDSL doc to deprecate input property - #2303
  • Fix ExplicitCollectionElementAccessMethod crash - #2302
  • ExplicitCollectionElementAccessMethod crashes - #2301

See all issues at: 1.5.1

1.5.0

28 Jan 17:51
5404407
Compare
Choose a tag to compare
Notable Changes
  • detekt is now silent by default. It only prints something if issues are found.
    Remove the following excludes if you want the old behavior back.
console-reports:
  active: true
  exclude:
     - 'ProjectStatisticsReport'
     - 'ComplexityReport'
     - 'NotificationReport'
  • detekt now fails the build if any issue is found. Change the maxIssues property to 10 for the old threshold.
build:
  maxIssues: 0
  • The HTML report now prints the issue count per rule and rule set.
  • New rules: ExplicitCollectionElementAccessMethod and ForbiddenMethod
Changelog
  • add new mention to README.md - #2293
  • Sort html report - #2290
  • Number format in some report - #2289
  • Show the finding count in the html report - #2288
  • Keep the order of the issues in the html report - #2287
  • Show issue count in the html report - #2286
  • Fixing the Documentation not properly calling the superclass - #2284
  • Do you have to call super in custom rules? - #2283
  • Measure performance of various stages when using --debug - #2281
  • Remove printing the whole config for --debug - #2280
  • Introduce DefaultRuleSetProvider interface marking detekt-rules providers as default - #2279
  • Simplify test dependency setup in build files - #2278
  • Fix class loader memory leaks when loading services - #2277
  • Always dispose Kotlin environment fixing memory leak in error cases - #2276
  • Sanitize gradle build scripts and suppress unstable api usages - #2271
  • Update website ruby dependencies fixing potential security vulnerability - #2270
  • Fix regression not considering baseline file when calculating build failure threshold - #2269
  • Turn detekt silent by default - #2268
  • Remove redundant build failure message - #2264 - #2266
  • Build failed with... is printed twice in the cli - #2264
  • Update config:maxIssues value to 0 - #2263
  • Don't flag inherited visibility in NestedClassesVisibility - #2261
  • Simplify argument parsing logic, remove any exitProcess() calls from buildRunner - #2260
  • Modify default behavior to not output unless errors are found. Adding a verbose flag which will have legacy behavior - #2258
  • Test some edge cases in detekt-api - #2256
  • Add a new line at the end of the txt report - #2255
  • Implement ExplicitCollectionElementAccessMethod rule - #2215
  • ForbiddenMethod Rule - #1954
  • NestedClassesVisibility(False negative): Nested class doesn't inherit visibility from parent - #1930

See all issues at: 1.5.0

1.4.0

12 Jan 19:22
3cfc27b
Compare
Choose a tag to compare
Notable Changes

New rule set coroutines with two specialized rules was added.
As always new rules must be activated by the user until they get stable.

coroutines:
  active: true
  GlobalCoroutineUsage:
    active: false
  RedundantSuspendModifier:
    active: false

Wrapped KtLint was updated to 0.36.0 introducing two rules

  • EnumEntryNameCase
  • NoEmptyFirstLineInMethodBlock
Migration

The properties ignoreOverriddenFunction and ignoreOverriddenFunctions of some rules got deprecated and unified to a new property ignoreOverridden.

Changelog
  • Refactor BuildFailure code - #2250
  • Fix nested methods bug in MethodOverloading rule - #2249
  • ThrowingExceptionInMain rule should consider main() function with no parameters - #2248
  • MethodOverloading bug with nested overloaded methods - #2247
  • Reduce complexity in FindingsReport - #2246
  • Add RedundantSuspendModifier rule - #2244
  • New ktlint rules - #2243
  • Inline MethodOverloading case file - #2241
  • ThrowingExceptionInMain: fix #2248 and add tests - #2240
  • Add disposing Kotlin environment. - #2238
  • OOM on multiple invocations - #2237
  • Improve doc for UnusedPrivateMember - #2236
  • Don't resolve dependencies during project configuration - #2235
  • Revert "Introduce Pull Request Labeler" - #2234
  • Fix #2230 equals() func detection - #2233
  • Fix git commit-hook label and code snippet doc - #2232
  • WrongEqualsTypeParameter does not ignore multi-parameter equals methods - #2230
  • Introduce Pull Request Labeler - #2228
  • Gradle plugin: Build upon default detekt config - #2227
  • Apply ktlint formatting plugin to Gradle plugin - #2226
  • Bump dependencies - #2225
  • Run shadowJar & installShadowDist task with everything else - #2220
  • Travis: Use consistent Java vendor - #2219
  • "Property is misspelled or does not exist" error for new rules in default rulesets - #2217
  • MethodOverloading false positive if every entry of an enum implement a method. - #2216
  • Add Git detekt pre-commit hook doc - #2214
  • Remove exclude workaround for new build property - #2203
  • Add GlobalCoroutineUsage rule + coroutines ruleset - #2174
  • Add rule [RedundantSuspend] to detect redundant suspend modifiers - #2156
  • Deprecate ignoreOverriddenFunction/s in favor of ignoreOverridden - #2132

See all issues at: 1.4.0

1.3.1

29 Dec 10:04
33d454d
Compare
Choose a tag to compare
  • Remove old unused documentation - #2210
  • Show code snippet erros in html reports - #2209
  • Use compileAndLint in UnusedPrivateClassSpec - #2208
  • Fix false positive in UnusedPrivateClass - #2207
  • Update readme promoting new properties of the gradle plugin - #2205
  • Rename default const containing ACCEPTED - #2204
  • Mistake From LongParameterList.kt - #2202
  • Exclude yet unknown new build property - #2201
  • Add comment regarding type resolution to README - #2199
  • Type resolution doc - #2198
  • Correct indentation for Groovy DSL doc - #2197
  • Use shorthand syntax for assertThat() - #2196
  • Refactor MagicNumber to use commaSeparatedPatterns - #2195
  • Attach FILE_PATH_USER_DATA_KEY user data on FormattingRules (#1907) - #2194
  • Handle invalid config exit code in gradle plugin - #2193
  • Add tests showing how to exclude custom config properties in plugins - #2192
  • Fix suppression of KtLint rules on file level - #2179 - #2191
  • Mention needed kotlinx.html library from jcenter - #2146 - #2190
  • UnusedPrivateClass has false positive behavior for deserialized items - #2158
  • Use JDK 11 (LTS) + 13 for AppVeyor builds - #2141
  • Document how to create a common baseline file for multi module gradle projects - #2140
  • DetektAll with baseline fails with error - #2100
  • ForbiddenMethod Rule - #1954
  • Do not report auto-corrected formatting issues - #1840

See all issues at: 1.3.1

1.3.0

22 Dec 11:03
e8ec25b
Compare
Choose a tag to compare
Notable changes
  • Minimal Gradle version increased to 5.0
  • New rules:
    • UnnecessaryAnnotationUseSiteTargetRule
    • MapGetWithNotNullAssertionOperator
Changelog
  • Add printers to the command line runner - #2188
  • Fix documentation of UseArrayLiteralsInAnnotations - #2186
  • Inline resolving severity label for XML reports - #2184
  • Extract common jvm target value, add jvmTarget into documentation. Cl… - #2183
  • Fix Detekt gradle task cache restoration issue (#2180) - #2182
  • Fix exception when running ArrayPrimitive on star-projected arrays - #2181
  • Gradle cache restoration issue - #2180
  • Add MacOS JDK13 build job to TravisCI - #2177
  • Running "ArrayPrimitive" rule on "Array<*>" causes detekt to throw exception - #2176
  • Update Spek to v2.0.9 - #2173
  • Create Rule: MapGetWithNotNullAssertionOperator - #2171
  • EqualsAlwaysReturnsTrueOrFalse fails hard on override fun equals(other:Any) = ... - #2167
  • Prepare 1.3.0 release - #2165
  • UnsafeCast: update documentation to match new behavior - #2164
  • Add jvmTarget change into documentation - #2157
  • Create UnnecessaryAnnotationUseSiteTargetRule - #2099
  • Gradle 6 - #1902
  • Gradle 6 planning - #1820

See all issues at: 1.3.0

1.2.2

05 Dec 07:10
Compare
Choose a tag to compare
Notable Changes
  • 1.2.1 introduced breaking changes for users of Gradle < 5. This was reverted.
  • 1.3.0 will drop support for Gradle < 5.
  • Fixed a regression in the html report.
Changelog
  • regression updating 1.2.0 to 1.2.1, unknown property 'filters' for object of type DetektExtension - #2163
  • StringIndexOutOfBoundsException when generating HTML report - #2160
  • Restore KotlinExtension - #2159
  • 1.2.1 breaks the build with: unresolved reference: detekt - #2152
  • Updated to correct classpath documentation for Android projects. - #2149
  • Update to Kotlin v1.3.61 - #2147
  • Document how to exclude detekt from the check task - #1894 - #2144
  • Use JDK 11 (LTS) + 13 for Travis builds - #2142
  • Don't compile test snippets (bindingContext) - #2137
  • StringIndexOutOfBoundsException: String index out of range: 8 when generating HTML report after update to 1.2.0 - #2134

See all issues at: 1.2.2