X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/117891878e5be4d6b771ae5de299e51b679cea27..6123b4ac2696116090fee3da77e9be66417980dd:/src/black/output.py?ds=inline diff --git a/src/black/output.py b/src/black/output.py index c85b253..f4c17f2 100644 --- a/src/black/output.py +++ b/src/black/output.py @@ -4,11 +4,11 @@ The double calls are for patching purposes in tests. """ import json -from typing import Any, Optional -from mypy_extensions import mypyc_attr import tempfile +from typing import Any, Optional from click import echo, style +from mypy_extensions import mypyc_attr @mypyc_attr(patchable=True) @@ -59,8 +59,8 @@ def diff(a: str, b: str, a_name: str, b_name: str) -> str: """Return a unified diff string between strings `a` and `b`.""" import difflib - a_lines = [line for line in a.splitlines(keepends=True)] - b_lines = [line for line in b.splitlines(keepends=True)] + a_lines = a.splitlines(keepends=True) + b_lines = b.splitlines(keepends=True) diff_lines = [] for line in difflib.unified_diff( a_lines, b_lines, fromfile=a_name, tofile=b_name, n=5 @@ -81,7 +81,7 @@ def color_diff(contents: str) -> str: lines = contents.split("\n") for i, line in enumerate(lines): if line.startswith("+++") or line.startswith("---"): - line = "\033[1;37m" + line + "\033[0m" # bold white, reset + line = "\033[1m" + line + "\033[0m" # bold, reset elif line.startswith("@@"): line = "\033[36m" + line + "\033[0m" # cyan, reset elif line.startswith("+"):