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 empty-let-in

+65 -53
+7
Cargo.lock
··· 341 341 ] 342 342 343 343 [[package]] 344 + name = "indoc" 345 + version = "2.0.6" 346 + source = "registry+https://github.com/rust-lang/crates.io-index" 347 + checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" 348 + 349 + [[package]] 344 350 name = "insta" 345 351 version = "1.43.2" 346 352 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 671 677 "ariadne", 672 678 "clap", 673 679 "ignore", 680 + "indoc", 674 681 "insta", 675 682 "lib", 676 683 "macros",
+1
Cargo.toml
··· 14 14 hex = "0.4.3" 15 15 ignore = "0.4.18" 16 16 indexmap = "1.6.2" 17 + indoc = "2.0.6" 17 18 insta = { features = ["filters"], version = "1.43.2" } 18 19 lazy_static = "1.0" 19 20 lib.path = "./lib"
+1
bin/Cargo.toml
··· 33 33 vfs.workspace = true 34 34 35 35 [dev-dependencies] 36 + indoc.workspace = true 36 37 insta.workspace = true 37 38 paste.workspace = true 38 39 strip-ansi-escapes.workspace = true
-14
bin/tests/data/empty_let_in.nix
··· 1 - [ 2 - ( 3 - let 4 - in 5 - null 6 - ) 7 - ( 8 - let 9 - # don't fix this, we have a comment 10 - # raise the lint though 11 - in 12 - null 13 - ) 14 - ]
+19
bin/tests/empty_let_in.rs
··· 1 + mod _utils; 2 + 3 + use indoc::indoc; 4 + 5 + use macros::generate_tests; 6 + 7 + generate_tests! { 8 + rule: empty_let_in, 9 + expressions: [ 10 + "let in null", 11 + indoc! {" 12 + let 13 + # don't fix this, we have a comment 14 + # raise the lint though 15 + in 16 + null 17 + "} 18 + ], 19 + }
-1
bin/tests/main.rs
··· 44 44 } 45 45 46 46 test_lint! { 47 - empty_let_in, 48 47 manual_inherit, 49 48 manual_inherit_from, 50 49 legacy_let_syntax,
+9
bin/tests/snapshots/empty_let_in__fix_5c1128abfe4ef6b1ed846295f216703aa1c58b4fcadad40bc25e05858c3bdd08.snap
··· 1 + --- 2 + source: bin/tests/empty_let_in.rs 3 + expression: "\"let in null\"" 4 + --- 5 + --- <temp_file_path> 6 + +++ <temp_file_path> [fixed] 7 + @@ -1 +1 @@ 8 + -let in null 9 + +null
+5
bin/tests/snapshots/empty_let_in__fix_69e2d9e348a3b7903ae167887886709559b8d299d9ea097621bbbab32e6f3bfa.snap
··· 1 + --- 2 + source: bin/tests/empty_let_in.rs 3 + expression: "\"let\\n # don't fix this, we have a comment\\n # raise the lint though\\nin\\nnull\\n\"" 4 + --- 5 +
+11
bin/tests/snapshots/empty_let_in__lint_5c1128abfe4ef6b1ed846295f216703aa1c58b4fcadad40bc25e05858c3bdd08.snap
··· 1 + --- 2 + source: bin/tests/empty_let_in.rs 3 + expression: "\"let in null\"" 4 + --- 5 + [W02] Warning: Useless let-in expression 6 + ╭─[<temp_file_path>:1:1] 7 + 8 + 1 │ let in null 9 + · ─────┬───── 10 + · ╰─────── This let-in expression has no entries 11 + ───╯
+12
bin/tests/snapshots/empty_let_in__lint_69e2d9e348a3b7903ae167887886709559b8d299d9ea097621bbbab32e6f3bfa.snap
··· 1 + --- 2 + source: bin/tests/empty_let_in.rs 3 + expression: "\"let\\n # don't fix this, we have a comment\\n # raise the lint though\\nin\\nnull\\n\"" 4 + --- 5 + [W02] Warning: Useless let-in expression 6 + ╭─[<temp_file_path>:1:1] 7 + 8 + 1 │ ╭─▶ let 9 + 5 │ ├─▶ null 10 + · │ 11 + · ╰────────── This let-in expression has no entries 12 + ───╯
-18
bin/tests/snapshots/main__empty_let_in_fix.snap
··· 1 - --- 2 - source: bin/tests/main.rs 3 - expression: "&stdout" 4 - --- 5 - --- tests/data/empty_let_in.nix 6 - +++ tests/data/empty_let_in.nix [fixed] 7 - @@ -1,10 +1,6 @@ 8 - [ 9 - - ( 10 - - let 11 - - in 12 - - null 13 - - ) 14 - + null 15 - ( 16 - let 17 - # don't fix this, we have a comment 18 - # raise the lint though
-20
bin/tests/snapshots/main__empty_let_in_lint.snap
··· 1 - --- 2 - source: bin/tests/main.rs 3 - expression: "&stdout" 4 - --- 5 - [W02] Warning: Useless let-in expression 6 - ╭─[tests/data/empty_let_in.nix:3:5] 7 - 8 - 3 │ ╭─▶ let 9 - 5 │ ├─▶ null 10 - · │ 11 - · ╰────────────── This let-in expression has no entries 12 - ───╯ 13 - [W02] Warning: Useless let-in expression 14 - ╭─[tests/data/empty_let_in.nix:8:5] 15 - 16 - 8 │ ╭─▶ let 17 - 12 │ ├─▶ null 18 - · │ 19 - · ╰────────────── This let-in expression has no entries 20 - ────╯