May be you can look if it is already done in ktlint-standard? If yes - simply inherit it with customizations
Only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed).
In case you prefer using tabs - just simply configure auto change of tabs to spaces in your IDE.
Exceptions:
- When breaking parameter list of a method/class constructor it can be aligned with 8 spaces or a parameter that was moved to a newline can be on the same level as the previous argument:
class Class(propertiesFileName: String,
otherName: String) {
or
fun visit(
node: ASTNode,
autoCorrect: Boolean,
params: KtLint.Params,
emit: (offset: Int, errorMessage: String, canBeAutoCorrected: Boolean) -> Unit
) {
- Operators like +/-/*/e.t.c can be indented with 8 spaces:
val abcdef = "my splitted" +
" string"
May be you can look if it is already done in ktlint-standard? If yes - simply inherit it with customizations
Only spaces are allowed for indentation and each indentation should equal to 4 spaces (tabs are not allowed).
In case you prefer using tabs - just simply configure auto change of tabs to spaces in your IDE.
Exceptions:
or