]>
git.madduck.net Git - etc/vim.git/commitdiff
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:
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f3f3acc )
)
THIS_FILE = Path(__file__)
)
THIS_FILE = Path(__file__)
+EMPTY_CONFIG = THIS_DIR / "data" / "empty_pyproject.toml"
PY36_ARGS = [f"--target-version={version.name.lower()}" for version in PY36_VERSIONS]
DEFAULT_EXCLUDE = black.re_compile_maybe_verbose(black.const.DEFAULT_EXCLUDES)
DEFAULT_INCLUDE = black.re_compile_maybe_verbose(black.const.DEFAULT_INCLUDES)
PY36_ARGS = [f"--target-version={version.name.lower()}" for version in PY36_VERSIONS]
DEFAULT_EXCLUDE = black.re_compile_maybe_verbose(black.const.DEFAULT_EXCLUDES)
DEFAULT_INCLUDE = black.re_compile_maybe_verbose(black.const.DEFAULT_INCLUDES)
source, expected = read_data("src/black/__init__", data=False)
result = BlackRunner().invoke(
black.main,
source, expected = read_data("src/black/__init__", data=False)
result = BlackRunner().invoke(
black.main,
- ["-", "--fast", f"--line-length={black.DEFAULT_LINE_LENGTH}"],
+ [
+ "-",
+ "--fast",
+ f"--line-length={black.DEFAULT_LINE_LENGTH}",
+ f"--config={EMPTY_CONFIG}",
+ ],
input=BytesIO(source.encode("utf8")),
)
self.assertEqual(result.exit_code, 0)
input=BytesIO(source.encode("utf8")),
)
self.assertEqual(result.exit_code, 0)
)
source, _ = read_data("expression.py")
expected, _ = read_data("expression.diff")
)
source, _ = read_data("expression.py")
expected, _ = read_data("expression.diff")
- config = THIS_DIR / "data" / "empty_pyproject.toml"
args = [
"-",
"--fast",
f"--line-length={black.DEFAULT_LINE_LENGTH}",
"--diff",
args = [
"-",
"--fast",
f"--line-length={black.DEFAULT_LINE_LENGTH}",
"--diff",
+ f"--config={EMPTY_CONFIG }",
]
result = BlackRunner().invoke(
black.main, args, input=BytesIO(source.encode("utf8"))
]
result = BlackRunner().invoke(
black.main, args, input=BytesIO(source.encode("utf8"))
def test_piping_diff_with_color(self) -> None:
source, _ = read_data("expression.py")
def test_piping_diff_with_color(self) -> None:
source, _ = read_data("expression.py")
- config = THIS_DIR / "data" / "empty_pyproject.toml"
args = [
"-",
"--fast",
f"--line-length={black.DEFAULT_LINE_LENGTH}",
"--diff",
"--color",
args = [
"-",
"--fast",
f"--line-length={black.DEFAULT_LINE_LENGTH}",
"--diff",
"--color",
+ f"--config={EMPTY_CONFIG }",
]
result = BlackRunner().invoke(
black.main, args, input=BytesIO(source.encode("utf8"))
]
result = BlackRunner().invoke(
black.main, args, input=BytesIO(source.encode("utf8"))
def test_expression_diff(self) -> None:
source, _ = read_data("expression.py")
def test_expression_diff(self) -> None:
source, _ = read_data("expression.py")
- config = THIS_DIR / "data" / "empty_pyproject.toml"
expected, _ = read_data("expression.diff")
tmp_file = Path(black.dump_to_file(source))
diff_header = re.compile(
expected, _ = read_data("expression.diff")
tmp_file = Path(black.dump_to_file(source))
diff_header = re.compile(
)
try:
result = BlackRunner().invoke(
)
try:
result = BlackRunner().invoke(
- black.main, ["--diff", str(tmp_file), f"--config={config }"]
+ black.main, ["--diff", str(tmp_file), f"--config={EMPTY_CONFIG }"]
)
self.assertEqual(result.exit_code, 0)
finally:
)
self.assertEqual(result.exit_code, 0)
finally:
def test_expression_diff_with_color(self) -> None:
source, _ = read_data("expression.py")
def test_expression_diff_with_color(self) -> None:
source, _ = read_data("expression.py")
- config = THIS_DIR / "data" / "empty_pyproject.toml"
expected, _ = read_data("expression.diff")
tmp_file = Path(black.dump_to_file(source))
try:
result = BlackRunner().invoke(
expected, _ = read_data("expression.diff")
tmp_file = Path(black.dump_to_file(source))
try:
result = BlackRunner().invoke(
- black.main, ["--diff", "--color", str(tmp_file), f"--config={config}"]
+ black.main,
+ ["--diff", "--color", str(tmp_file), f"--config={EMPTY_CONFIG}"],
)
finally:
os.unlink(tmp_file)
)
finally:
os.unlink(tmp_file)
r"\d\d:\d\d:\d\d\.\d\d\d\d\d\d \+\d\d\d\d"
)
try:
r"\d\d:\d\d:\d\d\.\d\d\d\d\d\d \+\d\d\d\d"
)
try:
- result = BlackRunner().invoke(black.main, ["-C", "--diff", str(tmp_file)])
+ result = BlackRunner().invoke(
+ black.main, ["-C", "--diff", str(tmp_file), f"--config={EMPTY_CONFIG}"]
+ )
self.assertEqual(result.exit_code, 0)
finally:
os.unlink(tmp_file)
self.assertEqual(result.exit_code, 0)
finally:
os.unlink(tmp_file)