Cannot disable multiline-if-else rule
See original GitHub issuei tried to disable said rule through the configuration of my build file however adding it to the disabledRules had no effect.
ktlint {
enableExperimentalRules.set(true)
disabledRules.set(
setOf(
"multiline-if-else",
"comment-spacing",
"curly-spacing",
"keyword-spacing",
"no-wildcard-imports"
)
)
}
im still gettting Missing { ... }
messages in the console and after checking the source code of ktlint, those are coming from multiline-if-else
im using version 9.3.0 of this plugin
the report can be found here
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ktlint's multiline-if-else rule not fixed automatically #1264
Task :spotlessKotlin FAILED Step 'ktlint' found problem in 'app/src/main/java/com/example/todoapp/MainActivity.kt': Error on line: 20, ...
Read more >Remove rules
Remove rules. If you want to change the behavior of styler to match your desired style, there are multiple ways: Use the tidyverse...
Read more >Formatting Rule Set | Detekt
This rule set provides wrappers for rules implemented by ktlint ... Note: The formatting rule set is not included in the detekt-cli or...
Read more >Static Analysis Tools - ktlint - The Android Arsenal
To disable a specific rule you'll need to turn on the verbose mode ( ktlint --verbose ... ). At the end of each...
Read more >Styling multi-line conditions in 'if' statements? - Stack Overflow
Moreover, the new rule is that the and and or statements should start on the next line ... P.s. I am not an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it looks like the issue was that i had to specify
experimental:multiline-if-else
insead ofmultiline-if-else
with this changed, everything works as expectedthe build script i took this from is here (with the difference that the rule isn’t in the disabled rules as it didnt do anything. but adding the experimental enable and the ignore line there will result in an exact copy of the build script i got this issue in)