From d1ff222bcf94152cd657233cffd8c14a45788c26 Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 29 Dec 2021 10:53:38 +0530 Subject: allow for version based lints --- bin/tests/data/faster_groupby.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 bin/tests/data/faster_groupby.nix (limited to 'bin/tests/data') diff --git a/bin/tests/data/faster_groupby.nix b/bin/tests/data/faster_groupby.nix new file mode 100644 index 0000000..30d1031 --- /dev/null +++ b/bin/tests/data/faster_groupby.nix @@ -0,0 +1,15 @@ +{ + # trivial case + _ = lib.groupBy (x: if x > 2 then "big" else "small") [ 1 2 3 4 5 ]; + + # offer lint heuristically on this too + _ = nixpkgs.lib.groupBy (x: if x > 2 then "big" else "small") [ 1 2 3 4 5 ]; + + # do not lint on `builtins` + _ = builtins.groupBy (x: x.name) [ + { name = "foo"; idx = 1; } + { name = "foo"; idx = 2; } + { name = "bar"; idx = 1; } + { name = "bar"; idx = 2; } + ]; +} -- cgit v1.2.3