Lints and suggestions for the Nix programming language
1
fork

Configure Feed

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

bump rnix to latest master, support nix 2.5 syntax

Akshay df29effd 8e4eeb97

+14 -7
+2 -3
Cargo.lock
··· 398 398 399 399 [[package]] 400 400 name = "rnix" 401 - version = "0.9.1" 402 - source = "registry+https://github.com/rust-lang/crates.io-index" 403 - checksum = "294becb48f58c496d96c10a12df290266204ca75c9799be4d04222bfaebb6a37" 401 + version = "0.10.1" 402 + source = "git+https://github.com/nix-community/rnix-parser?rev=8083f5694ddeaca47c946aa9ae7ecf117fa4823b#8083f5694ddeaca47c946aa9ae7ecf117fa4823b" 404 403 dependencies = [ 405 404 "cbitset", 406 405 "rowan",
+4 -1
bin/Cargo.toml
··· 16 16 17 17 [dependencies] 18 18 ariadne = "0.1.3" 19 - rnix = "0.9.0" 20 19 clap = "3.0.0-beta.4" 21 20 ignore = "0.4.18" 22 21 thiserror = "1.0.30" ··· 24 23 vfs = { path = "../vfs" } 25 24 lib = { path = "../lib" } 26 25 toml = "0.5.8" 26 + 27 + [dependencies.rnix] 28 + git = "https://github.com/nix-community/rnix-parser" 29 + rev = "8083f5694ddeaca47c946aa9ae7ecf117fa4823b" 27 30 28 31 [dependencies.serde] 29 32 version = "1.0.68"
+4 -1
lib/Cargo.toml
··· 7 7 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 8 9 9 [dependencies] 10 - rnix = "0.9.0" 11 10 if_chain = "1.0" 12 11 macros = { path = "../macros" } 13 12 lazy_static = "1.0" 14 13 rowan = "0.12.5" 15 14 serde_json = { version = "1.0.68", optional = true } 15 + 16 + [dependencies.rnix] 17 + git = "https://github.com/nix-community/rnix-parser" 18 + rev = "8083f5694ddeaca47c946aa9ae7ecf117fa4823b" 16 19 17 20 [dependencies.serde] 18 21 version = "1.0.130"
+3 -2
lib/src/lints/bool_comparison.rs
··· 41 41 if let Some(bin_expr) = BinOp::cast(node.clone()); 42 42 if let Some(lhs) = bin_expr.lhs(); 43 43 if let Some(rhs) = bin_expr.rhs(); 44 + if let Some(op) = bin_expr.operator(); 44 45 45 - if let op@(BinOpKind::Equal | BinOpKind::NotEqual) = bin_expr.operator(); 46 + if let BinOpKind::Equal | BinOpKind::NotEqual = op; 46 47 let (non_bool_side, bool_side) = if boolean_ident(&lhs).is_some() { 47 48 (rhs, lhs) 48 49 } else if boolean_ident(&rhs).is_some() { ··· 70 71 SyntaxKind::NODE_BIN_OP => { 71 72 let inner = BinOp::cast(non_bool_side.clone()).unwrap(); 72 73 // `!a ? b`, no paren required 73 - if inner.operator() == BinOpKind::IsSet { 74 + if inner.operator()? == BinOpKind::IsSet { 74 75 make::unary_not(&non_bool_side).node().clone() 75 76 } else { 76 77 let parens = make::parenthesize(&non_bool_side);
+1
lib/src/lints/empty_pattern.rs
··· 49 49 if let Some(body) = lambda_expr.body(); 50 50 51 51 if let Some(pattern) = Pattern::cast(arg.clone()); 52 + 52 53 // no patterns within `{ }` 53 54 if pattern.entries().count() == 0; 54 55 // pattern is not bound