Lints and suggestions for the Nix programming language
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: 1-expr tests legacy-let-syntax

+44 -32
-5
bin/tests/data/legacy_let_syntax.nix
··· 1 - let { 2 - body = x + y; 3 - x = "hello,"; 4 - y = " world!"; 5 - }
+18
bin/tests/legacy_let_syntax.rs
··· 1 + mod _utils; 2 + 3 + use indoc::indoc; 4 + 5 + use macros::generate_tests; 6 + 7 + generate_tests! { 8 + rule: manual_inherit, 9 + expressions: [ 10 + indoc! {r#" 11 + let { 12 + body = x + y; 13 + x = "hello,"; 14 + y = " world!"; 15 + } 16 + "#} 17 + ], 18 + }
-1
bin/tests/main.rs
··· 44 44 } 45 45 46 46 test_lint! { 47 - legacy_let_syntax, 48 47 collapsible_let_in, 49 48 eta_reduction, 50 49 useless_parens,
+14
bin/tests/snapshots/legacy_let_syntax__fix_7b38199c6c6f7f991caca355bdf9d4ebb9a8efc7745407121fc6b5702dd94e74.snap
··· 1 + --- 2 + source: bin/tests/legacy_let_syntax.rs 3 + expression: "\"let {\\n body = x + y;\\n x = \\\"hello,\\\";\\n y = \\\" world!\\\";\\n}\\n\"" 4 + --- 5 + --- <temp_file_path> 6 + +++ <temp_file_path> [fixed] 7 + @@ -1,6 +1,6 @@ 8 + -let { 9 + +rec { 10 + body = x + y; 11 + x = "hello,"; 12 + y = " world!"; 13 + -} 14 + +}.body
+12
bin/tests/snapshots/legacy_let_syntax__lint_7b38199c6c6f7f991caca355bdf9d4ebb9a8efc7745407121fc6b5702dd94e74.snap
··· 1 + --- 2 + source: bin/tests/legacy_let_syntax.rs 3 + expression: "\"let {\\n body = x + y;\\n x = \\\"hello,\\\";\\n y = \\\" world!\\\";\\n}\\n\"" 4 + --- 5 + [W05] Warning: Using undocumented `let` syntax 6 + ╭─[<temp_file_path>:1:1] 7 + 8 + 1 │ ╭─▶ let { 9 + 5 │ ├─▶ } 10 + · │ 11 + · ╰─────── Prefer rec over undocumented let syntax 12 + ───╯
-14
bin/tests/snapshots/main__legacy_let_syntax_fix.snap
··· 1 - --- 2 - source: bin/tests/main.rs 3 - expression: "&stdout" 4 - --- 5 - --- tests/data/legacy_let_syntax.nix 6 - +++ tests/data/legacy_let_syntax.nix [fixed] 7 - @@ -1,5 +1,5 @@ 8 - -let { 9 - +rec { 10 - body = x + y; 11 - x = "hello,"; 12 - y = " world!"; 13 - -} 14 - +}.body
-12
bin/tests/snapshots/main__legacy_let_syntax_lint.snap
··· 1 - --- 2 - source: bin/tests/main.rs 3 - expression: "&stdout" 4 - --- 5 - [W05] Warning: Using undocumented `let` syntax 6 - ╭─[tests/data/legacy_let_syntax.nix:1:1] 7 - 8 - 1 │ ╭─▶ let { 9 - 5 │ ├─▶ } 10 - · │ 11 - · ╰─────── Prefer rec over undocumented let syntax 12 - ───╯