From aa9470496698d2d4ea9e4f2b2742592611a30732 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 1 Dec 2025 19:19:22 +0100 Subject: [PATCH] check-meta.nix: Refactor for better use of parenthesis Remove some clearly-unnecessary ones and add some direly-needed ones Reapplying 43f81c8e08c7c8c7a7848a5e8ea73972c1f0f67a after reversal in 0b90ed8913d1bcdad80d99e1568e2139794efb08 --- pkgs/stdenv/generic/check-meta.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix index 4bf37706a939..067d0559c322 100644 --- a/pkgs/stdenv/generic/check-meta.nix +++ b/pkgs/stdenv/generic/check-meta.nix @@ -100,7 +100,7 @@ let isUnfree = licenses: if isAttrs licenses then - !licenses.free or true + !(licenses.free or true) # TODO: Returning false in the case of a string is a bug that should be fixed. # In a previous implementation of this function the function body # was `licenses: lib.lists.any (l: !l.free or true) licenses;` @@ -108,7 +108,7 @@ let else if isString licenses then false else - any (l: !l.free or true) licenses; + any (l: !(l.free or true)) licenses; hasUnfreeLicense = attrs: hasLicense attrs && isUnfree attrs.meta.license; @@ -173,7 +173,7 @@ let isNonSource = sourceTypes: any (t: !t.isSource) sourceTypes; hasNonSourceProvenance = - attrs: (attrs ? meta.sourceProvenance) && isNonSource attrs.meta.sourceProvenance; + attrs: attrs ? meta.sourceProvenance && isNonSource attrs.meta.sourceProvenance; # Allow granular checks to allow only some non-source-built packages # Example: @@ -753,15 +753,15 @@ let if valid == "yes" then true else if valid == "no" then - (handleEvalIssue { + handleEvalIssue { inherit meta attrs; inherit (validity) reason errormsg remediation; - }) + } else if valid == "warn" then - (handleEvalWarning { + handleEvalWarning { inherit meta attrs; inherit (validity) reason errormsg remediation; - }) + } else throw "Unknown validity: '${valid}'" );