Made ktlint -F return error code 1 when some of the violations cannot be auto-corrected (#162)
diff --git a/ktlint/src/main/kotlin/com/github/shyiko/ktlint/Main.kt b/ktlint/src/main/kotlin/com/github/shyiko/ktlint/Main.kt
index 585b377..e097b8c 100644
--- a/ktlint/src/main/kotlin/com/github/shyiko/ktlint/Main.kt
+++ b/ktlint/src/main/kotlin/com/github/shyiko/ktlint/Main.kt
@@ -277,6 +277,7 @@
format(fileName, fileContent, ruleSetProviders.map { it.second.get() }, userData) { err, corrected ->
if (!corrected) {
result.add(LintErrorWithCorrectionInfo(err, corrected))
+ tripped.set(true)
}
}
} catch (e: Exception) {