Merge pull request #349 from hercules-ci/issue-348
fix(inputs'): do not unnecessarily evaluate formatters
This commit is contained in:
commit
ae2918651e
2 changed files with 28 additions and 4 deletions
|
|
@ -567,6 +567,31 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
perInput = {
|
||||||
|
"test: inputs' does not evaluate input flake formatter" =
|
||||||
|
let
|
||||||
|
inputFlake = {
|
||||||
|
_type = "flake";
|
||||||
|
outPath = "/fake";
|
||||||
|
formatter = throw "must not evaluate input's formatter";
|
||||||
|
packages.a.hello = pkg "a" "hello";
|
||||||
|
};
|
||||||
|
self = { _type = "flake"; outPath = "/test"; inputs = { inherit self; dep = inputFlake; }; };
|
||||||
|
result = mkFlake
|
||||||
|
{ inputs = self.inputs; }
|
||||||
|
{
|
||||||
|
systems = [ "a" ];
|
||||||
|
perSystem = { inputs', ... }: {
|
||||||
|
packages.default = inputs'.dep.packages.hello;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
expr = (result.packages.a.default).name;
|
||||||
|
expected = "hello";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
formatter = {
|
formatter = {
|
||||||
"test: conditional null throws helpful error" = {
|
"test: conditional null throws helpful error" = {
|
||||||
expr =
|
expr =
|
||||||
|
|
|
||||||
|
|
@ -100,10 +100,9 @@ in
|
||||||
'')
|
'')
|
||||||
config.allSystems);
|
config.allSystems);
|
||||||
|
|
||||||
perInput = system: flake:
|
perInput = system: flake: {
|
||||||
optionalAttrs (flake?formatter.${system}) {
|
formatter = flake.formatter.${system};
|
||||||
formatter = flake.formatter.${system};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue