aboutsummaryrefslogtreecommitdiff
path: root/bin/tests/snapshots
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-11-03 09:18:35 +0000
committerAkshay <[email protected]>2021-11-08 05:03:13 +0000
commit4e063b2abc402ac4d6902647e821978269025c7d (patch)
treea8935a5432fe86d0e5facb9ff8acc71edcb7f782 /bin/tests/snapshots
parent78decf580d22fa792c19c40ace39762fb027067c (diff)
add snapshot test suitesnapshot-tests
Diffstat (limited to 'bin/tests/snapshots')
-rw-r--r--bin/tests/snapshots/main__bool_comparison.snap62
-rw-r--r--bin/tests/snapshots/main__collapsible_let_in.snap17
-rw-r--r--bin/tests/snapshots/main__deprecated_is_null.snap13
-rw-r--r--bin/tests/snapshots/main__empty_let_in.snap14
-rw-r--r--bin/tests/snapshots/main__empty_pattern.snap20
-rw-r--r--bin/tests/snapshots/main__eta_reduction.snap13
-rw-r--r--bin/tests/snapshots/main__legacy_let_syntax.snap14
-rw-r--r--bin/tests/snapshots/main__manual_inherit.snap13
-rw-r--r--bin/tests/snapshots/main__manual_inherit_from.snap20
-rw-r--r--bin/tests/snapshots/main__redundant_pattern_bind.snap13
-rw-r--r--bin/tests/snapshots/main__unquoted_splices.snap35
-rw-r--r--bin/tests/snapshots/main__unquoted_uri.snap13
-rw-r--r--bin/tests/snapshots/main__useless_parens.snap48
13 files changed, 295 insertions, 0 deletions
diff --git a/bin/tests/snapshots/main__bool_comparison.snap b/bin/tests/snapshots/main__bool_comparison.snap
new file mode 100644
index 0000000..0865332
--- /dev/null
+++ b/bin/tests/snapshots/main__bool_comparison.snap
@@ -0,0 +1,62 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W01] Warning: Unnecessary comparison with boolean
7 ╭─[data/bool_comparison.nix:3:4]
8
9 3 │ (a == true)
10 · ────┬────
11 · ╰────── Comparing a with boolean literal true
12───╯
13[W01] Warning: Unnecessary comparison with boolean
14 ╭─[data/bool_comparison.nix:4:4]
15
16 4 │ (b == true)
17 · ────┬────
18 · ╰────── Comparing b with boolean literal true
19───╯
20[W01] Warning: Unnecessary comparison with boolean
21 ╭─[data/bool_comparison.nix:5:4]
22
23 5 │ (true == c)
24 · ────┬────
25 · ╰────── Comparing c with boolean literal true
26───╯
27[W01] Warning: Unnecessary comparison with boolean
28 ╭─[data/bool_comparison.nix:6:4]
29
30 6 │ (true == d)
31 · ────┬────
32 · ╰────── Comparing d with boolean literal true
33───╯
34[W01] Warning: Unnecessary comparison with boolean
35 ╭─[data/bool_comparison.nix:9:4]
36
37 9 │ (e != true)
38 · ────┬────
39 · ╰────── Comparing e with boolean literal true
40───╯
41[W01] Warning: Unnecessary comparison with boolean
42 ╭─[data/bool_comparison.nix:10:4]
43
44 10 │ (f != false)
45 · ─────┬────
46 · ╰────── Comparing f with boolean literal false
47────╯
48[W01] Warning: Unnecessary comparison with boolean
49 ╭─[data/bool_comparison.nix:11:4]
50
51 11 │ (true != g)
52 · ────┬────
53 · ╰────── Comparing g with boolean literal true
54────╯
55[W01] Warning: Unnecessary comparison with boolean
56 ╭─[data/bool_comparison.nix:12:4]
57
58 12 │ (false != h)
59 · ─────┬────
60 · ╰────── Comparing h with boolean literal false
61────╯
62
diff --git a/bin/tests/snapshots/main__collapsible_let_in.snap b/bin/tests/snapshots/main__collapsible_let_in.snap
new file mode 100644
index 0000000..b135abc
--- /dev/null
+++ b/bin/tests/snapshots/main__collapsible_let_in.snap
@@ -0,0 +1,17 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W06] Warning: These let-in expressions are collapsible
7 ╭─[data/collapsible_let_in.nix:1:1]
8
9 1 │ ╭───▶ let
10 5 │ │ ╭─▶ let
11 9 │ │ ├─▶ a + b + c + d
12 · │ │ │
13 · │ ╰───────────────────── This let in expression is nested
14 · │ │
15 · ╰───────────────────┴─── This let in expression contains a nested let in expression
16───╯
17
diff --git a/bin/tests/snapshots/main__deprecated_is_null.snap b/bin/tests/snapshots/main__deprecated_is_null.snap
new file mode 100644
index 0000000..d49b381
--- /dev/null
+++ b/bin/tests/snapshots/main__deprecated_is_null.snap
@@ -0,0 +1,13 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W13] Warning: Found usage of deprecated builtin isNull
7 ╭─[data/deprecated_is_null.nix:4:4]
8
9 4 │ if isNull e
10 · ────┬───
11 · ╰───── isNull is deprecated, check equality with null instead
12───╯
13
diff --git a/bin/tests/snapshots/main__empty_let_in.snap b/bin/tests/snapshots/main__empty_let_in.snap
new file mode 100644
index 0000000..426692f
--- /dev/null
+++ b/bin/tests/snapshots/main__empty_let_in.snap
@@ -0,0 +1,14 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W02] Warning: Useless let-in expression
7 ╭─[data/empty_let_in.nix:1:1]
8
9 1 │ ╭─▶ let
10 3 │ ├─▶ null
11 · │
12 · ╰──────────── This let-in expression has no entries
13───╯
14
diff --git a/bin/tests/snapshots/main__empty_pattern.snap b/bin/tests/snapshots/main__empty_pattern.snap
new file mode 100644
index 0000000..3ea7ae0
--- /dev/null
+++ b/bin/tests/snapshots/main__empty_pattern.snap
@@ -0,0 +1,20 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W10] Warning: Found empty pattern in function argument
7 ╭─[data/empty_pattern.nix:3:4]
8
9 3 │ ({ ... }: 42)
10 · ───┬───
11 · ╰───── This pattern is empty, use _ instead
12───╯
13[W11] Warning: Found redundant pattern bind in function argument
14 ╭─[data/empty_pattern.nix:7:4]
15
16 7 │ ({ ... } @ inputs: inputs)
17 · ────────┬───────
18 · ╰───────── This pattern bind is redundant, use inputs instead
19───╯
20
diff --git a/bin/tests/snapshots/main__eta_reduction.snap b/bin/tests/snapshots/main__eta_reduction.snap
new file mode 100644
index 0000000..6271980
--- /dev/null
+++ b/bin/tests/snapshots/main__eta_reduction.snap
@@ -0,0 +1,13 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W07] Warning: This function expression is eta reducible
7 ╭─[data/eta_reduction.nix:11:9]
8
9 11 │ (map (x: double x) xs)
10 · ─────┬─────
11 · ╰─────── Found eta-reduction: double
12────╯
13
diff --git a/bin/tests/snapshots/main__legacy_let_syntax.snap b/bin/tests/snapshots/main__legacy_let_syntax.snap
new file mode 100644
index 0000000..35aa7ee
--- /dev/null
+++ b/bin/tests/snapshots/main__legacy_let_syntax.snap
@@ -0,0 +1,14 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W05] Warning: Using undocumented `let` syntax
7 ╭─[data/legacy_let_syntax.nix:1:1]
8
9 1 │ ╭─▶ let {
10 5 │ ├─▶ }
11 · │
12 · ╰─────── Prefer rec over undocumented let syntax
13───╯
14
diff --git a/bin/tests/snapshots/main__manual_inherit.snap b/bin/tests/snapshots/main__manual_inherit.snap
new file mode 100644
index 0000000..063867c
--- /dev/null
+++ b/bin/tests/snapshots/main__manual_inherit.snap
@@ -0,0 +1,13 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W03] Warning: Assignment instead of inherit
7 ╭─[data/manual_inherit.nix:7:3]
8
9 7 │ a = a;
10 · ───┬──
11 · ╰──── This assignment is better written with inherit
12───╯
13
diff --git a/bin/tests/snapshots/main__manual_inherit_from.snap b/bin/tests/snapshots/main__manual_inherit_from.snap
new file mode 100644
index 0000000..9cf1f5d
--- /dev/null
+++ b/bin/tests/snapshots/main__manual_inherit_from.snap
@@ -0,0 +1,20 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W04] Warning: Assignment instead of inherit from
7 ╭─[data/manual_inherit_from.nix:5:3]
8
9 5 │ b = a.b;
10 · ────┬───
11 · ╰───── This assignment is better written with inherit
12───╯
13[W04] Warning: Assignment instead of inherit from
14 ╭─[data/manual_inherit_from.nix:6:3]
15
16 6 │ c = a.c;
17 · ────┬───
18 · ╰───── This assignment is better written with inherit
19───╯
20
diff --git a/bin/tests/snapshots/main__redundant_pattern_bind.snap b/bin/tests/snapshots/main__redundant_pattern_bind.snap
new file mode 100644
index 0000000..2f26818
--- /dev/null
+++ b/bin/tests/snapshots/main__redundant_pattern_bind.snap
@@ -0,0 +1,13 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W11] Warning: Found redundant pattern bind in function argument
7 ╭─[data/redundant_pattern_bind.nix:1:1]
8
9 1 │ { ... } @ inputs: null
10 · ────────┬────────
11 · ╰────────── This pattern bind is redundant, use inputs instead
12───╯
13
diff --git a/bin/tests/snapshots/main__unquoted_splices.snap b/bin/tests/snapshots/main__unquoted_splices.snap
new file mode 100644
index 0000000..5fd1917
--- /dev/null
+++ b/bin/tests/snapshots/main__unquoted_splices.snap
@@ -0,0 +1,35 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W09] Warning: Found unquoted splice expression
7 ╭─[data/unquoted_splices.nix:7:3]
8
9 7 │ ${x}
10 · ──┬─
11 · ╰─── Consider quoting this splice expression
12───╯
13[W09] Warning: Found unquoted splice expression
14 ╭─[data/unquoted_splices.nix:8:3]
15
16 8 │ ${toString (x + y)}
17 · ─────────┬─────────
18 · ╰─────────── Consider quoting this splice expression
19───╯
20[W09] Warning: Found unquoted splice expression
21 ╭─[data/unquoted_splices.nix:9:5]
22
23 9 │ a.${toString x}
24 · ──────┬──────
25 · ╰──────── Consider quoting this splice expression
26───╯
27[W09] Warning: Found unquoted splice expression
28 ╭─[data/unquoted_splices.nix:12:3]
29
30 12 │ ╭─▶ ${
31 14 │ ├─▶ }
32 · │
33 · ╰───────── Consider quoting this splice expression
34────╯
35
diff --git a/bin/tests/snapshots/main__unquoted_uri.snap b/bin/tests/snapshots/main__unquoted_uri.snap
new file mode 100644
index 0000000..2f0e5a9
--- /dev/null
+++ b/bin/tests/snapshots/main__unquoted_uri.snap
@@ -0,0 +1,13 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W12] Warning: Found unquoted URI expression
7 ╭─[data/unquoted_uri.nix:1:1]
8
9 1 │ github:nerdypepper/statix
10 · ────────────┬────────────
11 · ╰────────────── Consider quoting this URI expression
12───╯
13
diff --git a/bin/tests/snapshots/main__useless_parens.snap b/bin/tests/snapshots/main__useless_parens.snap
new file mode 100644
index 0000000..d44176e
--- /dev/null
+++ b/bin/tests/snapshots/main__useless_parens.snap
@@ -0,0 +1,48 @@
1---
2source: bin/tests/main.rs
3expression: "&out"
4
5---
6[W08] Warning: These parentheses can be omitted
7 ╭─[data/useless_parens.nix:16:3]
8
9 16 │ (null)
10 · ───┬──
11 · ╰──── Useless parentheses around body of let expression
12────╯
13[W08] Warning: These parentheses can be omitted
14 ╭─[data/useless_parens.nix:4:9]
15
16 4 │ b = ("hello");
17 · ────┬────
18 · ╰────── Useless parentheses around value in binding
19───╯
20[W08] Warning: These parentheses can be omitted
21 ╭─[data/useless_parens.nix:5:9]
22
23 5 │ c = (d);
24 · ─┬─
25 · ╰─── Useless parentheses around value in binding
26───╯
27[W08] Warning: These parentheses can be omitted
28 ╭─[data/useless_parens.nix:6:9]
29
30 6 │ e = ({ f = 2; });
31 · ──────┬─────
32 · ╰─────── Useless parentheses around value in binding
33───╯
34[W08] Warning: These parentheses can be omitted
35 ╭─[data/useless_parens.nix:10:7]
36
37 10 │ g = (1 + 2);
38 · ───┬───
39 · ╰───── Useless parentheses around value in binding
40────╯
41[W08] Warning: These parentheses can be omitted
42 ╭─[data/useless_parens.nix:11:7]
43
44 11 │ h = ({ inherit i; });
45 · ────────┬───────
46 · ╰───────── Useless parentheses around value in binding
47────╯
48