Show a different summary if there are only errors
This commit is contained in:
@@ -43,15 +43,23 @@ def markdown_format_result(result: Result) -> str:
|
||||
return "\u2705 ecosystem check detected no format changes."
|
||||
|
||||
# Summarize the total changes
|
||||
s = "s" if total_files_modified != 1 else ""
|
||||
changes = f"+{total_lines_added} -{total_lines_removed} lines in {total_files_modified} file{s} in {len(result.completed)} projects"
|
||||
if error_count:
|
||||
if total_lines_added == 0 and total_lines_added == 0:
|
||||
# Only errors
|
||||
s = "s" if error_count != 1 else ""
|
||||
changes += f"; {error_count} project error{s}"
|
||||
lines.append(
|
||||
f"\u2139\ufe0f ecosystem check **encountered format errors**. (no format changes; {error_count} project error{s})"
|
||||
)
|
||||
else:
|
||||
s = "s" if total_files_modified != 1 else ""
|
||||
changes = f"+{total_lines_added} -{total_lines_removed} lines in {total_files_modified} file{s} in {len(result.completed)} projects"
|
||||
if error_count:
|
||||
s = "s" if error_count != 1 else ""
|
||||
changes += f"; {error_count} project error{s}"
|
||||
|
||||
lines.append(
|
||||
f"\u2139\ufe0f ecosystem check **detected format changes**. ({changes})"
|
||||
)
|
||||
|
||||
lines.append(
|
||||
f"\u2139\ufe0f ecosystem check **detected format changes**. ({changes})"
|
||||
)
|
||||
lines.append("")
|
||||
|
||||
# Then per-project changes
|
||||
|
||||
Reference in New Issue
Block a user