summary refs log tree commit diff
path: root/lib/debug.nix
diff options
context:
space:
mode:
authorBenjamin Staffin <benley@gmail.com>2017-03-11 17:39:40 -0500
committerBenjamin Staffin <benley@gmail.com>2017-03-11 17:48:43 -0500
commitd9123a2329f0d35af45d25aab5adb4348b8e3d56 (patch)
treedce5e2ee7790d49605cc9b3258f0740e29391644 /lib/debug.nix
parent3ea16e98b4722a86ccc38939100390b7abdfe72e (diff)
downloadnixpkgs-d9123a2329f0d35af45d25aab5adb4348b8e3d56.tar
nixpkgs-d9123a2329f0d35af45d25aab5adb4348b8e3d56.tar.gz
nixpkgs-d9123a2329f0d35af45d25aab5adb4348b8e3d56.tar.bz2
nixpkgs-d9123a2329f0d35af45d25aab5adb4348b8e3d56.tar.lz
nixpkgs-d9123a2329f0d35af45d25aab5adb4348b8e3d56.tar.xz
nixpkgs-d9123a2329f0d35af45d25aab5adb4348b8e3d56.tar.zst
nixpkgs-d9123a2329f0d35af45d25aab5adb4348b8e3d56.zip
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.
Diffstat (limited to 'lib/debug.nix')
-rw-r--r--lib/debug.nix14
1 files changed, 7 insertions, 7 deletions
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 "<no name>"}, { ${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"