diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/src/lint.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/bin/src/lint.rs b/bin/src/lint.rs index 055bb76..4a8c540 100644 --- a/bin/src/lint.rs +++ b/bin/src/lint.rs | |||
@@ -54,17 +54,20 @@ pub mod main { | |||
54 | pub fn main(check_config: CheckConfig) -> Result<(), StatixErr> { | 54 | pub fn main(check_config: CheckConfig) -> Result<(), StatixErr> { |
55 | let vfs = check_config.vfs()?; | 55 | let vfs = check_config.vfs()?; |
56 | let mut stdout = io::stdout(); | 56 | let mut stdout = io::stdout(); |
57 | |||
58 | let conf_file = ConfFile::discover(&check_config.conf_path)?; | 57 | let conf_file = ConfFile::discover(&check_config.conf_path)?; |
59 | let lints = conf_file.lints(); | 58 | let lints = conf_file.lints(); |
60 | let version = conf_file.version()?; | 59 | let version = conf_file.version()?; |
61 | |||
62 | let session = SessionInfo::from_version(version); | 60 | let session = SessionInfo::from_version(version); |
63 | |||
64 | let lint = |vfs_entry| lint_with(vfs_entry, &lints, &session); | 61 | let lint = |vfs_entry| lint_with(vfs_entry, &lints, &session); |
65 | vfs.iter().map(lint).for_each(|r| { | 62 | let results = vfs.iter().map(lint).collect::<Vec<_>>(); |
66 | stdout.write(&r, &vfs, check_config.format).unwrap(); | 63 | |
67 | }); | 64 | if results.len() != 0 { |
68 | Ok(()) | 65 | for r in &results { |
66 | stdout.write(&r, &vfs, check_config.format).unwrap(); | ||
67 | } | ||
68 | std::process::exit(1); | ||
69 | } | ||
70 | |||
71 | std::process::exit(0); | ||
69 | } | 72 | } |
70 | } | 73 | } |