From d26815e255d651b31fd58be7192d7378bc8037d1 Mon Sep 17 00:00:00 2001 From: Erik Hollensbe Date: Fri, 18 Feb 2022 09:49:28 -0800 Subject: [PATCH] ZLINT_WARN env var for controlling warnings-as-errors with zlint Signed-off-by: Erik Hollensbe --- src/test/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/mod.rs b/src/test/mod.rs index 5663e44..c060322 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -34,11 +34,14 @@ use tokio::sync::Mutex; use url::Url; const DEBUG_VAR: &str = "DEBUG"; +const ZLINT_WARN_VAR: &str = "ZLINT_WARN"; + const HBA_CONFIG_PATH: &str = "hack/pg_hba.conf"; static INIT: Once = Once::new(); lazy_static! { + static ref ZLINT_WARN: bool = !std::env::var(ZLINT_WARN_VAR).unwrap_or_default().is_empty(); static ref DEBUG: bool = !std::env::var(DEBUG_VAR).unwrap_or_default().is_empty(); static ref IMAGES: Vec<&'static str> = vec![ "certbot/certbot:latest", @@ -335,6 +338,12 @@ impl TestService { let key = key.clone(); s.insert(key); } + "warn" => { + if *ZLINT_WARN { + let key = key.clone(); + s.insert(key); + } + } _ => {} }; }