diff options
author | Akshay <[email protected]> | 2021-11-28 13:55:36 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2021-11-28 13:55:36 +0000 |
commit | 1079486539d44b2e70c623fb4948d6e0b9b11812 (patch) | |
tree | 7dc80cbfb44d31b8fd63955a290e687a32adbec1 | |
parent | cef2deec580acda72e0575b47b6415e5421736a7 (diff) |
remove lint: unquoted_splice
-rw-r--r-- | bin/src/config.rs | 4 | ||||
-rw-r--r-- | bin/src/fix.rs | 2 | ||||
-rw-r--r-- | bin/src/fix/all.rs | 2 | ||||
-rw-r--r-- | flake.lock | 18 | ||||
-rw-r--r-- | flake.nix | 2 | ||||
-rw-r--r-- | lib/src/lints.rs | 2 | ||||
-rw-r--r-- | 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<PathBuf>) -> Result<ReadOnlyVfs, ConfigErr> { | |||
334 | Ok(vfs) | 334 | Ok(vfs) |
335 | } | 335 | } |
336 | 336 | ||
337 | fn lints(conf_path: &PathBuf) -> Result<LintMap, ConfigErr> { | 337 | fn lints(conf_path: &Path) -> Result<LintMap, ConfigErr> { |
338 | let config_file = ConfFile::discover(conf_path)?; | 338 | let config_file = ConfFile::discover(conf_path)?; |
339 | Ok(utils::lint_map_of( | 339 | Ok(utils::lint_map_of( |
340 | (&*LINTS) | 340 | (&*LINTS) |
341 | .into_iter() | 341 | .iter() |
342 | .filter(|l| !config_file.disabled.iter().any(|check| check == l.name())) | 342 | .filter(|l| !config_file.disabled.iter().any(|check| check == l.name())) |
343 | .cloned() | 343 | .cloned() |
344 | .collect::<Vec<_>>() | 344 | .collect::<Vec<_>>() |
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 { | |||
100 | text_diff | 100 | text_diff |
101 | .unified_diff() | 101 | .unified_diff() |
102 | .context_radius(4) | 102 | .context_radius(4) |
103 | .header(&old_file, &new_file) | 103 | .header(old_file, &new_file) |
104 | ); | 104 | ); |
105 | } | 105 | } |
106 | (FixOut::Stream, single_result) => { | 106 | (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<Report>) -> Vec<Report> { | |||
57 | impl<'a> Iterator for FixResult<'a> { | 57 | impl<'a> Iterator for FixResult<'a> { |
58 | type Item = FixResult<'a>; | 58 | type Item = FixResult<'a>; |
59 | fn next(&mut self) -> Option<Self::Item> { | 59 | fn next(&mut self) -> Option<Self::Item> { |
60 | let all_reports = collect_fixes(&self.src, &self.lints).ok()?; | 60 | let all_reports = collect_fixes(&self.src, self.lints).ok()?; |
61 | if all_reports.is_empty() { | 61 | if all_reports.is_empty() { |
62 | return None; | 62 | return None; |
63 | } | 63 | } |
@@ -8,11 +8,11 @@ | |||
8 | "rust-analyzer-src": "rust-analyzer-src" | 8 | "rust-analyzer-src": "rust-analyzer-src" |
9 | }, | 9 | }, |
10 | "locked": { | 10 | "locked": { |
11 | "lastModified": 1635661416, | 11 | "lastModified": 1638080655, |
12 | "narHash": "sha256-8Bu1EdrPpGl4w1qlGGxlnEgYdkGkQpT4/4ZTq3z+1as=", | 12 | "narHash": "sha256-ZPx8e8CukEBx31IcgivAWnN9Jg0r+LTBPHV7fREf+QI=", |
13 | "owner": "nix-community", | 13 | "owner": "nix-community", |
14 | "repo": "fenix", | 14 | "repo": "fenix", |
15 | "rev": "1b311df00378e8e9ddc824983220e5ce644a8215", | 15 | "rev": "78a0c55b6f9d8bb6f3b89eb995fa5bbdd73e9475", |
16 | "type": "github" | 16 | "type": "github" |
17 | }, | 17 | }, |
18 | "original": { | 18 | "original": { |
@@ -43,11 +43,11 @@ | |||
43 | }, | 43 | }, |
44 | "nixpkgs": { | 44 | "nixpkgs": { |
45 | "locked": { | 45 | "locked": { |
46 | "lastModified": 1633422745, | 46 | "lastModified": 1638036523, |
47 | "narHash": "sha256-gA6Ok64nPbkjHk3Oanq4641EeYkjcKhisDF9wBjLxEk=", | 47 | "narHash": "sha256-ZL6gogsuBmhBvIro+YwRKrypYhwVPCOOO7FmhOV/xyE=", |
48 | "owner": "nixos", | 48 | "owner": "nixos", |
49 | "repo": "nixpkgs", | 49 | "repo": "nixpkgs", |
50 | "rev": "8e1eab9eae4278c9bb1dcae426848a581943db5a", | 50 | "rev": "9c191ebcdfe917043195c54ab6ae8e934434fe7b", |
51 | "type": "github" | 51 | "type": "github" |
52 | }, | 52 | }, |
53 | "original": { | 53 | "original": { |
@@ -67,11 +67,11 @@ | |||
67 | "rust-analyzer-src": { | 67 | "rust-analyzer-src": { |
68 | "flake": false, | 68 | "flake": false, |
69 | "locked": { | 69 | "locked": { |
70 | "lastModified": 1635274542, | 70 | "lastModified": 1638036899, |
71 | "narHash": "sha256-Cew1/WUozM3jalItPuj4cNN8GIFMvCaJ1KXoj6wrHwE=", | 71 | "narHash": "sha256-vh7z8jupVxXPOko3sWUsOB7eji/7lKfwJ/CE3iw97Sw=", |
72 | "owner": "rust-analyzer", | 72 | "owner": "rust-analyzer", |
73 | "repo": "rust-analyzer", | 73 | "repo": "rust-analyzer", |
74 | "rev": "dd43f3f2d13a32199828e758ddf13176df1f17f9", | 74 | "rev": "d9b2291f546abc77d24499339a72a89127464b95", |
75 | "type": "github" | 75 | "type": "github" |
76 | }, | 76 | }, |
77 | "original": { | 77 | "original": { |
@@ -59,6 +59,8 @@ | |||
59 | src = gitignoreSource ./.; | 59 | src = gitignoreSource ./.; |
60 | cargoLock.lockFile = ./Cargo.lock; | 60 | cargoLock.lockFile = ./Cargo.lock; |
61 | 61 | ||
62 | buildFeatures = "json"; | ||
63 | |||
62 | meta = with lib; { | 64 | meta = with lib; { |
63 | description = "Lints and suggestions for the Nix programming language"; | 65 | description = "Lints and suggestions for the Nix programming language"; |
64 | homepage = "https://git.peppe.rs/languages/statix/about"; | 66 | 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! { | |||
9 | collapsible_let_in, | 9 | collapsible_let_in, |
10 | eta_reduction, | 10 | eta_reduction, |
11 | useless_parens, | 11 | useless_parens, |
12 | unquoted_splice, | 12 | // unquoted_splice, |
13 | empty_pattern, | 13 | empty_pattern, |
14 | redundant_pattern_bind, | 14 | redundant_pattern_bind, |
15 | unquoted_uri, | 15 | unquoted_uri, |
@@ -98,8 +98,7 @@ your project root: | |||
98 | ``` | 98 | ``` |
99 | # within statix.toml | 99 | # within statix.toml |
100 | disabled = [ | 100 | disabled = [ |
101 | "unquoted_splice", | 101 | "empty_pattern" |
102 | "empty_pattern", | ||
103 | ] | 102 | ] |
104 | ``` | 103 | ``` |
105 | 104 | ||
@@ -108,7 +107,7 @@ traversing parents of the current directory and looking for | |||
108 | a `statix.toml` file. Alternatively, you can pass the path | 107 | a `statix.toml` file. Alternatively, you can pass the path |
109 | to the `statix.toml` file on the command line with the | 108 | to the `statix.toml` file on the command line with the |
110 | `--config` flag (available on `statix check` and `statix | 109 | `--config` flag (available on `statix check` and `statix |
111 | fix`. | 110 | fix`). |
112 | 111 | ||
113 | The available lints are: | 112 | The available lints are: |
114 | 113 | ||
@@ -121,7 +120,6 @@ legacy_let_syntax | |||
121 | collapsible_let_in | 120 | collapsible_let_in |
122 | eta_reduction | 121 | eta_reduction |
123 | useless_parens | 122 | useless_parens |
124 | unquoted_splice | ||
125 | empty_pattern | 123 | empty_pattern |
126 | redundant_pattern_bind | 124 | redundant_pattern_bind |
127 | unquoted_uri | 125 | unquoted_uri |