I'm in a 2 spaces project with the following code.
class ReaderFacade {
fun run() {
val output: Output = CsvOutput()
Okio.buffer(Okio.sink(File("output.${output.fileEnding}"))).use {
it.writeUtf8(stringOutput)
}
}
}
I'd expect it to get flagged since the line in use as well as the } is not indented correctly. Instead it should look like this:
- it.writeUtf8(stringOutput)
- }
+ it.writeUtf8(stringOutput)
+ }
I'm running version 0.15.0. Didn't try the snapshot out as it should only add quick fixing in case it gets reported. Correct me if I'm wrong.
This is due to two "limitations" of IndentionRule
}(line.length - previousIndent) % expectedIndentSize != 0}.Ideally, I'd like to make condition more strict (line.length - previousIndent) != expectedIndentSize. But for that we have to teach rule about all other elements (} etc).
I'm happy to work on that, but it will take some time.
Have there been any updates on this issue?
@Octogonapus Sorry, I didn't really made any progress here. But I'm still interested in that topic. Hopefully, I'll be able to come back soon.
Ok. Let me know if there is something I can do to help.
Moved to #338.
Most helpful comment
This is due to two "limitations" of
IndentionRule}(line.length - previousIndent) % expectedIndentSize != 0As result, not all violations are detected. This is also a reason why rule doesn't fail everywhere for
}.Ideally, I'd like to make condition more strict
(line.length - previousIndent) != expectedIndentSize. But for that we have to teach rule about all other elements (}etc).I'm happy to work on that, but it will take some time.