You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then ktlint 0.50.0 is not able to format the code correctly in 3 runs.
When linting the original code, the following is reported:
src/main/kotlin/UampNotificationManager.kt:6:50: Missing spacing before "{" (standard:curly-spacing)
src/main/kotlin/UampNotificationManager.kt:6:50: Expected a single white space before start of function body (standard:function-start-of-body-spacing)
src/main/kotlin/UampNotificationManager.kt:6:50: Expected a single space before body block (standard:function-signature)
12:11:35.739 [main] WARN com.pinterest.ktlint.cli.internal.KtlintCommandLine - Lint has found errors than can be autocorrected using 'ktlint --format'
So three different rules are reporting the same error.
When running format, the output is:
12:12:49.476 [pool-1-thread-1] WARN com.pinterest.ktlint.rule.engine.api.KtLintRuleEngine - Format was not able to resolve all violations which (theoretically) can be autocorrected in file .../src/main/kotlin/UampNotificationManager.kt in 3 consecutive runs of format.
Also, the file is formatted correctly and no more errors remain despite that formatting reports that not all problems were solved.
The problem is caused by inserting the whitespace element in the wrong position in the AST. If ktlint is restarted, the file is parsed again and the whitespace is in the expected place in the AST and no more error is to be fixed.
The text was updated successfully, but these errors were encountered:
Given code below:
and
.editorconfig
:then ktlint
0.50.0
is not able to format the code correctly in 3 runs.When linting the original code, the following is reported:
So three different rules are reporting the same error.
When running format, the output is:
Also, the file is formatted correctly and no more errors remain despite that formatting reports that not all problems were solved.
The problem is caused by inserting the whitespace element in the wrong position in the AST. If ktlint is restarted, the file is parsed again and the whitespace is in the expected place in the AST and no more error is to be fixed.
The text was updated successfully, but these errors were encountered: