diff options
Diffstat (limited to 'bin/src/lint.rs')
-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 c385007..055bb76 100644 --- a/bin/src/lint.rs +++ b/bin/src/lint.rs | |||
@@ -43,19 +43,22 @@ pub mod main { | |||
43 | use std::io; | 43 | use std::io; |
44 | 44 | ||
45 | use super::lint_with; | 45 | use super::lint_with; |
46 | use crate::{config::Check as CheckConfig, err::StatixErr, traits::WriteDiagnostic, utils}; | 46 | use crate::{ |
47 | config::{Check as CheckConfig, ConfFile}, | ||
48 | err::StatixErr, | ||
49 | traits::WriteDiagnostic, | ||
50 | }; | ||
47 | 51 | ||
48 | use lib::session::{SessionInfo, Version}; | 52 | use lib::session::SessionInfo; |
49 | 53 | ||
50 | pub fn main(check_config: CheckConfig) -> Result<(), StatixErr> { | 54 | pub fn main(check_config: CheckConfig) -> Result<(), StatixErr> { |
51 | let vfs = check_config.vfs()?; | 55 | let vfs = check_config.vfs()?; |
52 | let mut stdout = io::stdout(); | 56 | let mut stdout = io::stdout(); |
53 | let lints = check_config.lints()?; | ||
54 | 57 | ||
55 | let version = utils::get_version_info() | 58 | let conf_file = ConfFile::discover(&check_config.conf_path)?; |
56 | .unwrap() | 59 | let lints = conf_file.lints(); |
57 | .parse::<Version>() | 60 | let version = conf_file.version()?; |
58 | .unwrap(); | 61 | |
59 | let session = SessionInfo::from_version(version); | 62 | let session = SessionInfo::from_version(version); |
60 | 63 | ||
61 | let lint = |vfs_entry| lint_with(vfs_entry, &lints, &session); | 64 | let lint = |vfs_entry| lint_with(vfs_entry, &lints, &session); |