From 4e16d2fc293c315bf8f9ff8361e2302baba5f491 Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Fri, 9 May 2025 12:20:32 +0200 Subject: [PATCH] Remove flag --- README.md | 3 --- lychee-bin/src/client.rs | 21 +-------------------- lychee-bin/src/main.rs | 5 ----- lychee-bin/src/options.rs | 7 ------- 4 files changed, 1 insertion(+), 35 deletions(-) diff --git a/README.md b/README.md index 5586f27..7a0677a 100644 --- a/README.md +++ b/README.md @@ -445,9 +445,6 @@ Options: --exclude-loopback Exclude loopback IP address range and localhost from checking - --exclude-mail - Exclude all mail addresses from checking (deprecated; excluded by default) - --include-mail Also check email addresses diff --git a/lychee-bin/src/client.rs b/lychee-bin/src/client.rs index 7cedc91..e9ccf0d 100644 --- a/lychee-bin/src/client.rs +++ b/lychee-bin/src/client.rs @@ -34,25 +34,6 @@ pub(crate) fn create(cfg: &Config, cookie_jar: Option<&Arc>) - .map(|value| StatusCode::from_u16(*value)) .collect::, _>>()?; - // `exclude_mail` will be removed in 1.0. Until then, we need to support it. - // Therefore, we need to check if both `include_mail` and `exclude_mail` are set to `true` - // and return an error if that's the case. - if cfg.include_mail && cfg.exclude_mail { - return Err(anyhow::anyhow!( - "Cannot set both `include-mail` and `exclude-mail` to true" - )); - } - - // By default, clap sets `exclude_mail` to `false`. - // Therefore, we need to check if `exclude_mail` is explicitly set to - // `true`. If so, we need to set `include_mail` to `false`. - // Otherwise, we use the value of `include_mail`. - let include_mail = if cfg.exclude_mail { - false - } else { - cfg.include_mail - }; - ClientBuilder::builder() .remaps(remaps) .base(cfg.base_url.clone()) @@ -62,7 +43,7 @@ pub(crate) fn create(cfg: &Config, cookie_jar: Option<&Arc>) - .exclude_private_ips(cfg.exclude_private) .exclude_link_local_ips(cfg.exclude_link_local) .exclude_loopback_ips(cfg.exclude_loopback) - .include_mail(include_mail) + .include_mail(cfg.include_mail) .max_redirects(cfg.max_redirects) .user_agent(cfg.user_agent.clone()) .allow_insecure(cfg.insecure) diff --git a/lychee-bin/src/main.rs b/lychee-bin/src/main.rs index 0b9dca7..c9966d4 100644 --- a/lychee-bin/src/main.rs +++ b/lychee-bin/src/main.rs @@ -172,11 +172,6 @@ fn load_config() -> Result { warn!("WARNING: `--exclude-file` is deprecated and will soon be removed; use the `{LYCHEE_IGNORE_FILE}` file to ignore URL patterns instead. To exclude paths of files and directories, use `--exclude-path`."); } - // TODO: Remove this warning and the parameter with 1.0 - if opts.config.exclude_mail { - warn!("WARNING: `--exclude-mail` is deprecated and will soon be removed; E-Mail is no longer checked by default. Use `--include-mail` to enable E-Mail checking."); - } - // TODO: Remove this warning and the parameter with 1.0 if opts.config.base.is_some() { warn!( diff --git a/lychee-bin/src/options.rs b/lychee-bin/src/options.rs index a8f0016..a10f775 100644 --- a/lychee-bin/src/options.rs +++ b/lychee-bin/src/options.rs @@ -427,12 +427,6 @@ and 501." #[serde(default)] pub(crate) exclude_loopback: bool, - /// Exclude all mail addresses from checking - /// (deprecated; excluded by default) - #[arg(long)] - #[serde(default)] - pub(crate) exclude_mail: bool, - /// Also check email addresses #[arg(long)] #[serde(default)] @@ -621,7 +615,6 @@ impl Config { exclude_private: false; exclude_link_local: false; exclude_loopback: false; - exclude_mail: false; format: StatsFormat::default(); remap: Vec::::new(); fallback_extensions: Vec::::new();