Only print lint warnings if there are any.
>
@@ -237,6 +237,7 @@ def main(argv=None):
)
# Parse output.
+ if linter_result.returncode:
eprint("+++ :gear: Parsing buildifier output")
findings = list(regex.finditer(linter_result.stderr))
output += create_heading("lint", len(findings))
@@ -255,10 +256,11 @@ def main(argv=None):
finding["message_url"], finding["message_id"], finding["message"]
)
output = output.strip() + "</pre></code>"
+
upload_output(output)
# Preserve buildifier's exit code.
- return linter_result.returncode
+ return max(linter_result.returncode, formatter_result.returncode)
if __name__ == "__main__":
