aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/src/config.rs4
-rw-r--r--bin/src/fix.rs2
-rw-r--r--bin/src/fix/all.rs2
-rw-r--r--flake.lock18
-rw-r--r--flake.nix2
-rw-r--r--lib/src/lints.rs2
-rw-r--r--readme.md6
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
337fn lints(conf_path: &PathBuf) -> Result<LintMap, ConfigErr> { 337fn 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> {
57impl<'a> Iterator for FixResult<'a> { 57impl<'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 }
diff --git a/flake.lock b/flake.lock
index 5e46066..ace5efe 100644
--- a/flake.lock
+++ b/flake.lock
@@ -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": {
diff --git a/flake.nix b/flake.nix
index 241eb2b..8809d64 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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,
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:
98``` 98```
99# within statix.toml 99# within statix.toml
100disabled = [ 100disabled = [
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
108a `statix.toml` file. Alternatively, you can pass the path 107a `statix.toml` file. Alternatively, you can pass the path
109to the `statix.toml` file on the command line with the 108to 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
111fix`. 110fix`).
112 111
113The available lints are: 112The available lints are:
114 113
@@ -121,7 +120,6 @@ legacy_let_syntax
121collapsible_let_in 120collapsible_let_in
122eta_reduction 121eta_reduction
123useless_parens 122useless_parens
124unquoted_splice
125empty_pattern 123empty_pattern
126redundant_pattern_bind 124redundant_pattern_bind
127unquoted_uri 125unquoted_uri