From 1079486539d44b2e70c623fb4948d6e0b9b11812 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 28 Nov 2021 19:25:36 +0530 Subject: remove lint: unquoted_splice --- bin/src/config.rs | 4 ++-- bin/src/fix.rs | 2 +- bin/src/fix/all.rs | 2 +- flake.lock | 18 +++++++++--------- flake.nix | 2 ++ lib/src/lints.rs | 2 +- readme.md | 6 ++---- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bin/src/config.rs b/bin/src/config.rs index b6310e6..572ddde 100644 --- a/bin/src/config.rs +++ b/bin/src/config.rs @@ -334,11 +334,11 @@ fn vfs(files: Vec) -> Result { Ok(vfs) } -fn lints(conf_path: &PathBuf) -> Result { +fn lints(conf_path: &Path) -> Result { let config_file = ConfFile::discover(conf_path)?; Ok(utils::lint_map_of( (&*LINTS) - .into_iter() + .iter() .filter(|l| !config_file.disabled.iter().any(|check| check == l.name())) .cloned() .collect::>() diff --git a/bin/src/fix.rs b/bin/src/fix.rs index 4268567..a035379 100644 --- a/bin/src/fix.rs +++ b/bin/src/fix.rs @@ -100,7 +100,7 @@ pub mod main { text_diff .unified_diff() .context_radius(4) - .header(&old_file, &new_file) + .header(old_file, &new_file) ); } (FixOut::Stream, single_result) => { diff --git a/bin/src/fix/all.rs b/bin/src/fix/all.rs index bbc39e8..7e51d16 100644 --- a/bin/src/fix/all.rs +++ b/bin/src/fix/all.rs @@ -57,7 +57,7 @@ fn reorder(mut reports: Vec) -> Vec { impl<'a> Iterator for FixResult<'a> { type Item = FixResult<'a>; fn next(&mut self) -> Option { - let all_reports = collect_fixes(&self.src, &self.lints).ok()?; + let all_reports = collect_fixes(&self.src, self.lints).ok()?; if all_reports.is_empty() { return None; } diff --git a/flake.lock b/flake.lock index 5e46066..ace5efe 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1635661416, - "narHash": "sha256-8Bu1EdrPpGl4w1qlGGxlnEgYdkGkQpT4/4ZTq3z+1as=", + "lastModified": 1638080655, + "narHash": "sha256-ZPx8e8CukEBx31IcgivAWnN9Jg0r+LTBPHV7fREf+QI=", "owner": "nix-community", "repo": "fenix", - "rev": "1b311df00378e8e9ddc824983220e5ce644a8215", + "rev": "78a0c55b6f9d8bb6f3b89eb995fa5bbdd73e9475", "type": "github" }, "original": { @@ -43,11 +43,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1633422745, - "narHash": "sha256-gA6Ok64nPbkjHk3Oanq4641EeYkjcKhisDF9wBjLxEk=", + "lastModified": 1638036523, + "narHash": "sha256-ZL6gogsuBmhBvIro+YwRKrypYhwVPCOOO7FmhOV/xyE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8e1eab9eae4278c9bb1dcae426848a581943db5a", + "rev": "9c191ebcdfe917043195c54ab6ae8e934434fe7b", "type": "github" }, "original": { @@ -67,11 +67,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1635274542, - "narHash": "sha256-Cew1/WUozM3jalItPuj4cNN8GIFMvCaJ1KXoj6wrHwE=", + "lastModified": 1638036899, + "narHash": "sha256-vh7z8jupVxXPOko3sWUsOB7eji/7lKfwJ/CE3iw97Sw=", "owner": "rust-analyzer", "repo": "rust-analyzer", - "rev": "dd43f3f2d13a32199828e758ddf13176df1f17f9", + "rev": "d9b2291f546abc77d24499339a72a89127464b95", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 241eb2b..8809d64 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,8 @@ src = gitignoreSource ./.; cargoLock.lockFile = ./Cargo.lock; + buildFeatures = "json"; + meta = with lib; { description = "Lints and suggestions for the Nix programming language"; homepage = "https://git.peppe.rs/languages/statix/about"; diff --git a/lib/src/lints.rs b/lib/src/lints.rs index b4d4af3..891e3c8 100644 --- a/lib/src/lints.rs +++ b/lib/src/lints.rs @@ -9,7 +9,7 @@ lints! { collapsible_let_in, eta_reduction, useless_parens, - unquoted_splice, + // unquoted_splice, empty_pattern, redundant_pattern_bind, unquoted_uri, diff --git a/readme.md b/readme.md index e715a1b..bfc6fdc 100644 --- a/readme.md +++ b/readme.md @@ -98,8 +98,7 @@ your project root: ``` # within statix.toml disabled = [ - "unquoted_splice", - "empty_pattern", + "empty_pattern" ] ``` @@ -108,7 +107,7 @@ traversing parents of the current directory and looking for a `statix.toml` file. Alternatively, you can pass the path to the `statix.toml` file on the command line with the `--config` flag (available on `statix check` and `statix -fix`. +fix`). The available lints are: @@ -121,7 +120,6 @@ legacy_let_syntax collapsible_let_in eta_reduction useless_parens -unquoted_splice empty_pattern redundant_pattern_bind unquoted_uri -- cgit v1.2.3