Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added decent coloring #2712

Merged
merged 8 commits into from Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/black/__init__.py
Expand Up @@ -494,6 +494,7 @@ def main(
workers=workers,
)

out()
if verbose or not quiet:
out(error_msg if report.return_code else "All done! ✨ 🍰 ✨")
VanSHOE marked this conversation as resolved.
Show resolved Hide resolved
if code is None:
Expand Down
8 changes: 6 additions & 2 deletions src/black/report.py
Expand Up @@ -93,11 +93,15 @@ def __str__(self) -> str:
if self.change_count:
s = "s" if self.change_count > 1 else ""
report.append(
style(f"{self.change_count} file{s} {reformatted}", bold=True)
style(f"{self.change_count} file{s} ", bold=True, fg="blue")
+ style(f"{reformatted}", bold=True)
)

if self.same_count:
s = "s" if self.same_count > 1 else ""
report.append(f"{self.same_count} file{s} {unchanged}")
report.append(
style(f"{self.same_count} file{s} ", fg="blue") + f"{unchanged}"
)
if self.failure_count:
s = "s" if self.failure_count > 1 else ""
report.append(style(f"{self.failure_count} file{s} {failed}", fg="red"))
Expand Down