Closed Jolanrensen closed 1 month ago
Given:
class DB { operator fun <T> get(query: DB.() -> T): T = TODO() } val db = DB() val query = db[{ 123 }]
so, an operator get function with a lambda argument inside, KtLint should be happy with this notation. It is accepted by IntelliJ.
We get a linting error: Lint error > [standard:curly-spacing] Missing spacing before "{".
Lint error > [standard:curly-spacing] Missing spacing before "{"
If I run the formatter instead it performs a fix and reverts it again: Format fixed > [standard:curly-spacing] Missing spacing before "{"
Format fixed > [standard:curly-spacing] Missing spacing before "{"
Format fixed > [standard:square-brackets-spacing] Unexpected spacing after '['
See the example above.
ktlint_code_style = intellij_idea
Expected Behavior
Given:
so, an operator get function with a lambda argument inside, KtLint should be happy with this notation. It is accepted by IntelliJ.
Observed Behavior
We get a linting error:
Lint error > [standard:curly-spacing] Missing spacing before "{"
.If I run the formatter instead it performs a fix and reverts it again:
Format fixed > [standard:curly-spacing] Missing spacing before "{"
Format fixed > [standard:square-brackets-spacing] Unexpected spacing after '['
Steps to Reproduce
See the example above.
Your Environment
ktlint_code_style = intellij_idea