diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/Cargo.toml | 9 | ||||
-rw-r--r-- | bin/src/lint.rs | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/bin/Cargo.toml b/bin/Cargo.toml index bf39a3a..715e466 100644 --- a/bin/Cargo.toml +++ b/bin/Cargo.toml | |||
@@ -16,14 +16,15 @@ path = "src/main.rs" | |||
16 | 16 | ||
17 | [dependencies] | 17 | [dependencies] |
18 | ariadne = "0.1.3" | 18 | ariadne = "0.1.3" |
19 | rnix = "0.10.1" | ||
20 | clap = "3.0.0-beta.4" | 19 | clap = "3.0.0-beta.4" |
21 | ignore = "0.4.18" | 20 | ignore = "0.4.18" |
22 | thiserror = "1.0.30" | ||
23 | similar = "2.1.0" | ||
24 | vfs = { path = "../vfs" } | ||
25 | lib = { path = "../lib" } | 21 | lib = { path = "../lib" } |
22 | rayon = "1.5.1" | ||
23 | rnix = "0.10.1" | ||
24 | similar = "2.1.0" | ||
25 | thiserror = "1.0.30" | ||
26 | toml = "0.5.8" | 26 | toml = "0.5.8" |
27 | vfs = { path = "../vfs" } | ||
27 | 28 | ||
28 | [dependencies.serde] | 29 | [dependencies.serde] |
29 | version = "1.0.68" | 30 | version = "1.0.68" |
diff --git a/bin/src/lint.rs b/bin/src/lint.rs index 23a1d10..e1544e1 100644 --- a/bin/src/lint.rs +++ b/bin/src/lint.rs | |||
@@ -50,6 +50,7 @@ pub mod main { | |||
50 | }; | 50 | }; |
51 | 51 | ||
52 | use lib::session::SessionInfo; | 52 | use lib::session::SessionInfo; |
53 | use rayon::prelude::*; | ||
53 | 54 | ||
54 | pub fn main(check_config: CheckConfig) -> Result<(), StatixErr> { | 55 | pub fn main(check_config: CheckConfig) -> Result<(), StatixErr> { |
55 | let vfs = check_config.vfs()?; | 56 | let vfs = check_config.vfs()?; |
@@ -59,9 +60,13 @@ pub mod main { | |||
59 | let version = conf_file.version()?; | 60 | let version = conf_file.version()?; |
60 | let session = SessionInfo::from_version(version); | 61 | let session = SessionInfo::from_version(version); |
61 | let lint = |vfs_entry| lint_with(vfs_entry, &lints, &session); | 62 | let lint = |vfs_entry| lint_with(vfs_entry, &lints, &session); |
62 | let results = vfs.iter().map(lint).collect::<Vec<_>>(); | 63 | let results = vfs |
64 | .par_iter() | ||
65 | .map(lint) | ||
66 | .filter(|lr| !lr.reports.is_empty()) | ||
67 | .collect::<Vec<_>>(); | ||
63 | 68 | ||
64 | if results.iter().map(|r| r.reports.len()).sum::<usize>() != 0 { | 69 | if results.len() != 0 { |
65 | for r in &results { | 70 | for r in &results { |
66 | stdout.write(&r, &vfs, check_config.format).unwrap(); | 71 | stdout.write(&r, &vfs, check_config.format).unwrap(); |
67 | } | 72 | } |