diff --git a/src/lib.rs b/src/lib.rs index 644354a..d252d18 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,6 +21,7 @@ mod rules; mod utils; pub use crate::config::Config; +pub use crate::errors::LintLevel; pub use crate::output::{rdf::RdfFormatter, simple::SimpleFormatter, LintOutput, OutputFormatter}; pub use crate::utils::is_lintable; diff --git a/src/main.rs b/src/main.rs index f59ba96..030a817 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ use glob::glob; use log::{debug, error}; use simplelog::{ColorChoice, Config as LogConfig, LevelFilter, TermLogger, TerminalMode}; use supa_mdx_lint::{ - is_lintable, Config, LintOutput, LintTarget, Linter, LinterBuilder, OutputFormatter, + is_lintable, Config, LintLevel, LintOutput, LintTarget, Linter, LinterBuilder, OutputFormatter, }; const DEFAULT_CONFIG_FILE: &str = "supa-mdx-lint.config.toml"; @@ -145,7 +145,10 @@ fn execute() -> Result> { stdout.flush()?; - if diagnostics.iter().any(|d| !d.errors().is_empty()) { + if diagnostics + .iter() + .any(|d| d.errors().iter().any(|e| e.level == LintLevel::Error)) + { Ok(Err(anyhow::anyhow!("Linting errors found"))) } else { Ok(Ok(()))