Closed mnewlive closed 4 years ago
Use this settings, and use 4 in field Continuation indent
:
Everything seems to work, but I'm sure it will be right :thinking: :wink:
Also, if the indentation of a line is more than the required one, but in multiples of the set indentation value, ktlint fails to report an error.
Example: An error will be reported in this case:
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) // 10 spaces indent
setContentView(R.layout.main_activity)
}
but not in this case:
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) // 12 spaces indent, should be 8 ideally.
setContentView(R.layout.main_activity)
}
I am seeing the same issue as @GurpreetSK95. When a continuation indent is any multiple of the indent size it passes validation.
fun findById(id: String): Mono<Thing> =
databaseClient
.execute(SqlStatements.findById)
.bind("id", id)
.map(Thing::map)
.first()
I think this should count as a violation.
To me, this is a bug in ktlint. IntelliJ IDEA Ultimate Edition default settings should be regarded as correct, they are "from the creators".
@lxdraw @imGurpreetSK this should be fixed already - please use the latest version. @mnewlive let's track this in #805 - I've filed an issue on JB's side, hopefully we'll get some guidance
The same bug
Have next code:
Specifies the same error for all four parameters:
I tried to configure the project as shown here and here But the error remained.
Some code from my root
build.gradle
: