Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-F doesn't correct indentation errors #893

Closed
adiknoth opened this issue Sep 7, 2020 · 0 comments · Fixed by #1025
Closed

-F doesn't correct indentation errors #893

adiknoth opened this issue Sep 7, 2020 · 0 comments · Fixed by #1025

Comments

@adiknoth
Copy link

adiknoth commented Sep 7, 2020

Expected Behavior

$ ktlint -F should format everything according to style. Just do it, no matter what.

Observed Behavior

Unexpected indentation (expected 16, actual 12)

Steps to Reproduce

    private fun replaceLogger(deviceId: String, orgName: String) {
        stateManager
            .firebaseLogger = Logging(
            mode = if (BuildConfig.DEBUG) Logging.Companion.LogDestination.DEV else Logging.Companion.LogDestination.PROD,
            appInstanceIdentity = deviceId,
            org = orgName
        )
        stateManager.firebaseLogger.tellTheCloudAboutMe()
        customisation.attachToFirebase(stateManager.firebaseLogger.appCloudPrefix)
    }

Your Environment

  • Version of ktlint used: 0.38.1
  • Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task):
repositories {
    jcenter()
}

configurations {
    ktlint
}

dependencies {
    // TODO: Do we need to file? Are they non-3rd party ways of running ktlint as a presubmit?
    ktlint 'com.pinterest:ktlint:0.38.1'
}

task ktlint(type: JavaExec, group: "verification") {
    description = "Check Kotlin code style."
    classpath = configurations.ktlint
    main = "com.pinterest.ktlint.Main"
    args "src/**/*.kt"
}
check.dependsOn ktlint

task ktlintFormat(type: JavaExec, group: "formatting") {
    description = "Fix Kotlin code style deviations."
    classpath = configurations.ktlint
    main = "com.pinterest.ktlint.Main"
    args "-F", "src/**/*.kt"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants