Skip to content

Commit

Permalink
remove auto correct flag. Now auto correction works.
Browse files Browse the repository at this point in the history
Looks like KtLint passes wrong value for autoCorrect flag
  • Loading branch information
MyDogTom committed Feb 14, 2018
1 parent abb5197 commit cac9492
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ class CustomIndentationRule : Rule("custom-indent") {
" indentation (${line.length}) (" +
"parameters should be vertically aligned)",
true)
if (autoCorrect) replaceWithExpectedIndent(node, firstParameterColumn.value - 1)
replaceWithExpectedIndent(node, firstParameterColumn.value - 1)
}
} else if (line.isNotEmpty() && (line.length - previousIndent) % expectedIndentSize != 0) {

emit(offset,
" indentation (${line.length - previousIndent}) " +
"(it should be $expectedIndentSize)",
true)
if (autoCorrect) replaceWithExpectedIndent(node, previousIndent + expectedIndentSize)
replaceWithExpectedIndent(node, previousIndent + expectedIndentSize)
}
offset += line.length + 1
}
Expand Down

0 comments on commit cac9492

Please # to comment.