Edit me

Recipe: diff your detekt config with the default one

detekt’s ./gradlew detektGenerateConfig task copies the default configuration file to the location specified by the config property. detekt { ... config = files(...) ... } When the file on this location already exists, your configuration won’t be overwritten, and the task is a noop....

Howto: make detekt silent

detekt’s reporting mechanism relies on implementations of ConsoleReport’s. The cli module and therefore the Gradle plugin implement a bunch of this reports. A typical detekt report will look like following: There are many different parts which might or might not interest you. If one part...

Calling it One Zero

Today we are announcing the 1.0 release of detekt, a static code analysis tool for Kotlin. It operates on the abstract syntax tree provided by the Kotlin compiler and finds common programming flaws like unused or too complex constructs. Think of it as pmd or checkstyle but for Kotlin.

Howto: using snapshot releases of detekt

detekt uses bintray for releases and artifactory for snapshots. To configure snapshot usage in your gradle plugin apply the following changes to your build file: detekt { // if a new release of detekt stays binary compatible with a previous...

Howto: migrating from the *test-pattern*

Starting with RC15 the test-pattern is obsolete. This post shows how to leverage rule path excludes to achieve the same functionality. With version < RC15 the configuration file allowed to specify which paths should be mapped to test files so detekt would not run specific rule sets and rules on...

Howto: configure detekt for gradle root project

When configuring detekt for your Gradle based project, you basically have two options: for each sub module a new gradle task should be created or one uber-task analyzes your whole project For the first option, please see how detekt itself creates a task for each module:

Howto: build upon the default yaml config file

A common use case of detekt users was to build upon the default config file and use a second config file to override some defaults. Speaking in Gradle terms, this could look like following: detekt { ... config = files

Website Online

As of today the website was launched!

RSS Subscribe

See more posts from the News Archive.