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

Kotlinter doesn't match cli behavior for multiline-if-else rule #276

Closed
andrewg opened this issue Sep 8, 2022 · 2 comments
Closed

Kotlinter doesn't match cli behavior for multiline-if-else rule #276

andrewg opened this issue Sep 8, 2022 · 2 comments

Comments

@andrewg
Copy link

andrewg commented Sep 8, 2022

ktlint: 0.47.1
kotlinter: 3.11.1
standard rules except disabled_rules import-ordering and filename in both build.gradle and .editorconfig (have the same issue as #262)

It's in the standard rules but kotlinter doesn't seem to be failing on it: https://github.com/pinterest/ktlint/blob/0.47.1/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/MultiLineIfElseRule.kt

❯ ./gradlew buildEnvironment | grep kotlinter
\--- org.jmailen.kotlinter:org.jmailen.kotlinter.gradle.plugin:3.11.1
     \--- org.jmailen.gradle:kotlinter-gradle:3.11.1

❯ ktlint --version
0.47.1

❯ ./gradlew lintKotlin

BUILD SUCCESSFUL in 3s
2 actionable tasks: 2 executed

❯ ktlint
15:51:53.350 [main] INFO com.pinterest.ktlint.internal.KtlintCommandLine - Enable default patterns [**/*.kt, **/*.kts]
*****.kt:77:16: Missing { ... } (multiline-if-else)
*****.kt:78:16: Missing { ... } (multiline-if-else)
...
@mateuszkwiecinski
Copy link
Collaborator

3.11.1 uses ktlint version 0.46.0. The upgrade to 0.47.1 was merged yesterday, but hasn't been released yet.
If you want to try 0.47.1 with kotlinter 3.11.1 you may want to visit Custom ktlint version section in Readme 👀 It'll call ktlint using deprecated apis, but it should produce the same results as your CLI

@andrewg
Copy link
Author

andrewg commented Sep 9, 2022

Oh my bad, I had just done a search and saw it was at at 0.47.1 but didn't check against the tag. Thanks for the info!

@andrewg andrewg closed this as completed Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants