From 4f33658cee579564bba3165ec67488aac2aff455 Mon Sep 17 00:00:00 2001 From: Robin Quintero Date: Mon, 3 Jul 2023 13:37:52 -0500 Subject: [PATCH] feat(build): #1099 fix testlicense bug - fix `testlicense` still appears when there is no references. Signed-off-by: Robin Quintero --- docs/src/api/builtins/test.md | 8 ++++++-- makes.nix | 4 +++- src/evaluator/modules/test-license/default.nix | 9 +++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/src/api/builtins/test.md b/docs/src/api/builtins/test.md index 3a8bad96..e3156d86 100644 --- a/docs/src/api/builtins/test.md +++ b/docs/src/api/builtins/test.md @@ -4,7 +4,9 @@ Test the license of a project using [reuse](https://reuse.software/). Types: -- testLicense: Empty attribute set. +- testLicense: + - enable (`bool`): Optional. + Defaults to `false`. Example: @@ -12,7 +14,9 @@ Example: ```nix { - testLicense = {}; + testLicense = { + enable = true; + }; } ``` diff --git a/makes.nix b/makes.nix index 24e256ea..0bfa9bb5 100644 --- a/makes.nix +++ b/makes.nix @@ -252,7 +252,9 @@ }; }; }; - testLicense = {}; + testLicense = { + enable = true; + }; testPython = { example = { python = "3.11"; diff --git a/src/evaluator/modules/test-license/default.nix b/src/evaluator/modules/test-license/default.nix index 5372481d..b182cbc0 100644 --- a/src/evaluator/modules/test-license/default.nix +++ b/src/evaluator/modules/test-license/default.nix @@ -4,11 +4,16 @@ ... }: { options = { - testLicense = {}; + testLicense = { + enable = lib.mkOption { + default = false; + type = lib.types.bool; + }; + }; }; config = { outputs = { - "/testLicense" = testLicense; + "/testLicense" = lib.mkIf config.testLicense.enable testLicense; }; }; }