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 = {
|
||||
"test: conditional null throws helpful error" = {
|
||||
expr =
|
||||
|
|
|
|||
|
|
@ -100,8 +100,7 @@ in
|
|||
'')
|
||||
config.allSystems);
|
||||
|
||||
perInput = system: flake:
|
||||
optionalAttrs (flake?formatter.${system}) {
|
||||
perInput = system: flake: {
|
||||
formatter = flake.formatter.${system};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue