From d9123a2329f0d35af45d25aab5adb4348b8e3d56 Mon Sep 17 00:00:00 2001 From: Benjamin Staffin Date: Sat, 11 Mar 2017 17:39:40 -0500 Subject: lib: fix mixed tab/space indents, trailing whitespace, etc Nix style seems to have settled on not using spaces between bound variable names and the lambda : so I also tried to make those somewhat more consistent throughout. --- lib/debug.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/debug.nix') diff --git a/lib/debug.nix b/lib/debug.nix index e2e895ab620..5b3878554c5 100644 --- a/lib/debug.nix +++ b/lib/debug.nix @@ -24,10 +24,10 @@ rec { traceValSeq = v: traceVal (builtins.deepSeq v v); # this can help debug your code as well - designed to not produce thousands of lines - traceShowVal = x : trace (showVal x) x; + traceShowVal = x: trace (showVal x) x; traceShowValMarked = str: x: trace (str + showVal x) x; - attrNamesToStr = a : lib.concatStringsSep "; " (map (x : "${x}=") (attrNames a)); - showVal = x : + attrNamesToStr = a: lib.concatStringsSep "; " (map (x: "${x}=") (attrNames a)); + showVal = x: if isAttrs x then if x ? outPath then "x is a derivation, name ${if x ? name then x.name else ""}, { ${attrNamesToStr x} }" else "x is attr set { ${attrNamesToStr x} }" @@ -43,9 +43,9 @@ rec { # trace the arguments passed to function and its result # maybe rewrite these functions in a traceCallXml like style. Then one function is enough - traceCall = n : f : a : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a)); - traceCall2 = n : f : a : b : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b)); - traceCall3 = n : f : a : b : c : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b) (t "arg 3" c)); + traceCall = n: f: a: let t = n2: x: traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a)); + traceCall2 = n: f: a: b: let t = n2: x: traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b)); + traceCall3 = n: f: a: b: c: let t = n2: x: traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b) (t "arg 3" c)); # FIXME: rename this? traceValIfNot = c: x: @@ -71,7 +71,7 @@ rec { # create a test assuming that list elements are true # usage: { testX = allTrue [ true ]; } - testAllTrue = expr : { inherit expr; expected = map (x: true) expr; }; + testAllTrue = expr: { inherit expr; expected = map (x: true) expr; }; strict = v: trace "Warning: strict is deprecated and will be removed in the next release" -- cgit 1.4.1