aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/tests/data/useless_has_attr.nix1
-rw-r--r--bin/tests/snapshots/main__useless_has_attr.snap7
2 files changed, 8 insertions, 0 deletions
diff --git a/bin/tests/data/useless_has_attr.nix b/bin/tests/data/useless_has_attr.nix
index f4c9fd5..10966ac 100644
--- a/bin/tests/data/useless_has_attr.nix
+++ b/bin/tests/data/useless_has_attr.nix
@@ -6,4 +6,5 @@
6 6
7 # complex body 7 # complex body
8 (if x ? a then x.a else if b then c else d) 8 (if x ? a then x.a else if b then c else d)
9 (if x ? a then x.a else b.c)
9] 10]
diff --git a/bin/tests/snapshots/main__useless_has_attr.snap b/bin/tests/snapshots/main__useless_has_attr.snap
index df72eaf..d9b5ac8 100644
--- a/bin/tests/snapshots/main__useless_has_attr.snap
+++ b/bin/tests/snapshots/main__useless_has_attr.snap
@@ -31,4 +31,11 @@ expression: "&out"
31 · ────────────────────┬──────────────────── 31 · ────────────────────┬────────────────────
32 · ╰────────────────────── Consider using x.a or (if b then c else d) instead of this if expression 32 · ╰────────────────────── Consider using x.a or (if b then c else d) instead of this if expression
33───╯ 33───╯
34[W19] Warning: This `if` expression can be simplified with `or`
35 ╭─[data/useless_has_attr.nix:9:4]
36
37 9 │ (if x ? a then x.a else b.c)
38 · ─────────────┬────────────
39 · ╰────────────── Consider using x.a or b.c instead of this if expression
40───╯
34 41