Ensure that fix instructions are given when we have format errors
This would otherwise reset to false whenever we had a correctly formatted file (or batch for kotlin)
Change-Id: I85cdb29b88a2f18591fc3637df734617363860f6
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 2ba3d30..8e1d1bd 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -73,13 +73,16 @@
continue
pending_kotlin_files.append(path)
if len(pending_kotlin_files) == KOTLIN_FMT_BATCH_SIZE:
- seen_kotlin_error = CheckKotlinFormatting(pending_kotlin_files, output_api, results)
+ seen_kotlin_error = (CheckKotlinFormatting(pending_kotlin_files, output_api, results)
+ or seen_kotlin_error)
pending_kotlin_files = []
else:
- seen_java_error = CheckJavaFormatting(path, branch, output_api, results)
+ seen_java_error = (CheckJavaFormatting(path, branch, output_api, results)
+ or seen_java_error)
# Check remaining Kotlin files if any.
if len(pending_kotlin_files) > 0:
- seen_kotlin_error = CheckKotlinFormatting(pending_kotlin_files, output_api, results)
+ seen_kotlin_error = (CheckKotlinFormatting(pending_kotlin_files, output_api, results)
+ or seen_kotlin_error)
# Provide the reformatting commands if needed.
if seen_kotlin_error:
results.append(output_api.PresubmitError(KotlinFormatPresubmitMessage()))