madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged.
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
-from typing import Any, Optional
-from mypy_extensions import mypyc_attr
+from typing import Any, Optional
from click import echo, style
from click import echo, style
+from mypy_extensions import mypyc_attr
@mypyc_attr(patchable=True)
@mypyc_attr(patchable=True)
"""Return a unified diff string between strings `a` and `b`."""
import difflib
"""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
diff_lines = []
for line in difflib.unified_diff(
a_lines, b_lines, fromfile=a_name, tofile=b_name, n=5
lines = contents.split("\n")
for i, line in enumerate(lines):
if line.startswith("+++") or line.startswith("---"):
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("+"):
elif line.startswith("@@"):
line = "\033[36m" + line + "\033[0m" # cyan, reset
elif line.startswith("+"):