Fix unnecessary if checks (#1728)
This commit is contained in:
parent
82c1f871d0
commit
172c0a78fa
@ -859,9 +859,9 @@ def color_diff(contents: str) -> str:
|
|||||||
for i, line in enumerate(lines):
|
for i, line in enumerate(lines):
|
||||||
if line.startswith("+++") or line.startswith("---"):
|
if line.startswith("+++") or line.startswith("---"):
|
||||||
line = "\033[1;37m" + line + "\033[0m" # bold white, reset
|
line = "\033[1;37m" + line + "\033[0m" # bold white, reset
|
||||||
if line.startswith("@@"):
|
elif line.startswith("@@"):
|
||||||
line = "\033[36m" + line + "\033[0m" # cyan, reset
|
line = "\033[36m" + line + "\033[0m" # cyan, reset
|
||||||
if line.startswith("+"):
|
elif line.startswith("+"):
|
||||||
line = "\033[32m" + line + "\033[0m" # green, reset
|
line = "\033[32m" + line + "\033[0m" # green, reset
|
||||||
elif line.startswith("-"):
|
elif line.startswith("-"):
|
||||||
line = "\033[31m" + line + "\033[0m" # red, reset
|
line = "\033[31m" + line + "\033[0m" # red, reset
|
||||||
|
Loading…
Reference in New Issue
Block a user