forked from lix-project/nix-eval-jobs
Add Python Black formatter
This commit is contained in:
parent
2a26070ea4
commit
83773704be
|
@ -33,6 +33,7 @@ in
|
||||||
|
|
||||||
(pkgs.python3.withPackages (ps: [
|
(pkgs.python3.withPackages (ps: [
|
||||||
ps.pytest
|
ps.pytest
|
||||||
|
ps.black
|
||||||
]))
|
]))
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -30,11 +30,11 @@ def common_test(extra_args: List[str]) -> None:
|
||||||
assert built_job["name"] == "job1"
|
assert built_job["name"] == "job1"
|
||||||
assert built_job["outputs"]["out"].startswith("/nix/store")
|
assert built_job["outputs"]["out"].startswith("/nix/store")
|
||||||
assert built_job["drvPath"].endswith(".drv")
|
assert built_job["drvPath"].endswith(".drv")
|
||||||
assert built_job["meta"]['broken'] is False
|
assert built_job["meta"]["broken"] is False
|
||||||
|
|
||||||
dotted_job = results[1]
|
dotted_job = results[1]
|
||||||
assert dotted_job["attr"] == "\"dotted.attr\""
|
assert dotted_job["attr"] == '"dotted.attr"'
|
||||||
assert dotted_job["attrPath"] == [ "dotted.attr" ]
|
assert dotted_job["attrPath"] == ["dotted.attr"]
|
||||||
|
|
||||||
recurse_drv = results[2]
|
recurse_drv = results[2]
|
||||||
assert recurse_drv["attr"] == "recurse.drvB"
|
assert recurse_drv["attr"] == "recurse.drvB"
|
||||||
|
@ -46,7 +46,7 @@ def common_test(extra_args: List[str]) -> None:
|
||||||
substituted_job = results[4]
|
substituted_job = results[4]
|
||||||
assert substituted_job["attr"] == "substitutedJob"
|
assert substituted_job["attr"] == "substitutedJob"
|
||||||
assert substituted_job["name"].startswith("hello-")
|
assert substituted_job["name"].startswith("hello-")
|
||||||
assert substituted_job["meta"]['broken'] is False
|
assert substituted_job["meta"]["broken"] is False
|
||||||
|
|
||||||
|
|
||||||
def test_flake() -> None:
|
def test_flake() -> None:
|
||||||
|
|
|
@ -15,3 +15,7 @@ includes = ["*.nix"]
|
||||||
command = "prettier"
|
command = "prettier"
|
||||||
options = ["--write"]
|
options = ["--write"]
|
||||||
includes = ["*.toml"]
|
includes = ["*.toml"]
|
||||||
|
|
||||||
|
[formatter.python]
|
||||||
|
command = "black"
|
||||||
|
includes = ["*.py"]
|
||||||
|
|
Loading…
Reference in a new issue