diff options
author | Jan Malakhovski <oxij@oxij.org> | 2019-02-23 18:06:51 +0000 |
---|---|---|
committer | danbst <abcz2.uprola@gmail.com> | 2019-03-08 11:19:18 +0200 |
commit | 570aed4b46916551da969c4daeef0322461ac2fe (patch) | |
tree | 8d97355584bef4d77c1c60ef9966e65c59074bbe /lib | |
parent | e84cf5edad010da2bb9b8ed638b3bd190f3c08c3 (diff) | |
download | nixpkgs-570aed4b46916551da969c4daeef0322461ac2fe.tar nixpkgs-570aed4b46916551da969c4daeef0322461ac2fe.tar.gz nixpkgs-570aed4b46916551da969c4daeef0322461ac2fe.tar.bz2 nixpkgs-570aed4b46916551da969c4daeef0322461ac2fe.tar.lz nixpkgs-570aed4b46916551da969c4daeef0322461ac2fe.tar.xz nixpkgs-570aed4b46916551da969c4daeef0322461ac2fe.tar.zst nixpkgs-570aed4b46916551da969c4daeef0322461ac2fe.zip |
lib: add `showWarnings`
Diffstat (limited to 'lib')
-rw-r--r-- | lib/default.nix | 2 | ||||
-rw-r--r-- | lib/trivial.nix | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/default.nix b/lib/default.nix index dbb90081b2c..688c117d52b 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -59,7 +59,7 @@ let stringLength sub substring tail; inherit (trivial) id const concat or and bitAnd bitOr bitXor bitNot boolToString mergeAttrs flip mapNullable inNixShell min max - importJSON warn info nixpkgsVersion version mod compare + importJSON warn info showWarnings nixpkgsVersion version mod compare splitByAndCompare functionArgs setFunctionArgs isFunction; inherit (fixedPoints) fix fix' converge extends composeExtensions makeExtensible makeExtensibleWithCustomName; diff --git a/lib/trivial.nix b/lib/trivial.nix index 3f0816b5540..2d682961035 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -259,9 +259,10 @@ rec { # TODO: figure out a clever way to integrate location information from # something like __unsafeGetAttrPos. - warn = msg: builtins.trace "WARNING: ${msg}"; + warn = msg: builtins.trace "[1;31mwarning: ${msg}[0m"; info = msg: builtins.trace "INFO: ${msg}"; + showWarnings = warnings: res: lib.fold (w: x: warn w x) res warnings; ## Function annotations |