diff options
author | Akshay <[email protected]> | 2022-01-14 16:51:42 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2022-01-14 16:51:42 +0000 |
commit | 305960c98b3b71d4b915003430730c76fcda3af3 (patch) | |
tree | 09a428186f1aaacca8c4447f2feb7e08aa204217 /bin/src/lint.rs | |
parent | 7d732a051e695353db5a3ddbb26ab766ff736043 (diff) |
add dump command, support version overrides in statix.tomlsession-info
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); |