Skip to content

ktlint integration does not report most errors #2161

Closed
@Grannath

Description

@Grannath

Hopefully I did not miss anything, but then again there is not much documentation to go by.

Expected Behavior

The Detekt Gradle plugin, with the KtLint wrapper extension as a dependency, reports all issues the standalone version of KtLint does.

Observed Behavior

On a small project, KtLint reports about 20 issues, while Detekt reports none.

Steps to Reproduce

Have a Gradle project with

plugins {
    id "io.gitlab.arturbosch.detekt" version "1.2.1"
}

dependencies {
    detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.2.1"
}

in the build script. Have some issues like

  • Imports must be ordered in lexicographic order without any empty lines in-between
  • Missing spacing before ":"
  • Parameter should be on a separate line (unless all parameters can fit a single line)
    Now compare results from running ./gradlew detekt and ktlint.

Context

I only noticed this by accident. So I do not know how long this was the case. I'll see in my other projects if they have the same issue.

Your Environment

  • Version of detekt used: 1.2.1
  • Version of Gradle used 5.4.1
  • Operating System and version: Manjaro Linux and OpenJDK 8 (ask if you need anything specific)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions