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
In our company we are enforcing to remove curly braces whenever possible for example in if that have a single statement, this lead us to find a situation that was not expected with keyword-spacing rule.
This is a new case of #756 that I have spotted in the wild
Expected Behavior
Do not require else to be in the same line of a right brace if the right brace is not part of the if statement.
Observed Behavior
[keyword-spacing] Unexpected newline before "else"
Steps to Reproduce
if (foo !=false)
try {
foo2()
} catch (e:Throwable) {
bar
}
else foo
Your Environment
Version of ktlint used: 0.39
Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): org.jmailen.gradle:kotlinter-gradle:3.2.0
Version of Gradle used (if applicable): 6.7.1
Operating System and version: Mac OS Catalina 10.15.7
The text was updated successfully, but these errors were encountered:
In our company we are enforcing to remove curly braces whenever possible for example in if that have a single statement, this lead us to find a situation that was not expected with keyword-spacing rule.
This is a new case of #756 that I have spotted in the wild
Expected Behavior
Do not require else to be in the same line of a right brace if the right brace is not part of the if statement.
Observed Behavior
[keyword-spacing] Unexpected newline before "else"
Steps to Reproduce
Your Environment
The text was updated successfully, but these errors were encountered: