aboutsummaryrefslogtreecommitdiff
path: root/bin/tests/data
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-12-29 05:23:38 +0000
committerAkshay <[email protected]>2022-01-08 10:33:10 +0000
commitd1ff222bcf94152cd657233cffd8c14a45788c26 (patch)
treefb8c94daefe0384a48b503fdd4bfaff905d78e2f /bin/tests/data
parent94a2edf57340ac3f3a2276c88a221ba3125172af (diff)
allow for version based lints
Diffstat (limited to 'bin/tests/data')
-rw-r--r--bin/tests/data/faster_groupby.nix15
1 files changed, 15 insertions, 0 deletions
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 @@
1{
2 # trivial case
3 _ = lib.groupBy (x: if x > 2 then "big" else "small") [ 1 2 3 4 5 ];
4
5 # offer lint heuristically on this too
6 _ = nixpkgs.lib.groupBy (x: if x > 2 then "big" else "small") [ 1 2 3 4 5 ];
7
8 # do not lint on `builtins`
9 _ = builtins.groupBy (x: x.name) [
10 { name = "foo"; idx = 1; }
11 { name = "foo"; idx = 2; }
12 { name = "bar"; idx = 1; }
13 { name = "bar"; idx = 2; }
14 ];
15}