From 879a060996811b2195c926d1977f2055ce580897 Mon Sep 17 00:00:00 2001 From: m Date: Sun, 2 Jun 2024 19:16:45 -0700 Subject: [PATCH] lint & doc fixes --- src/config.rs | 1 - src/main.rs | 3 +-- src/query.rs | 13 ++++++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/config.rs b/src/config.rs index 73084ab13..ce412d5f0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -302,7 +302,6 @@ impl GlobalConfig { &self.query_overrides } - #[must_use] pub fn all_queries(&self) -> anyhow::Result> { let mut queries = SemverQuery::all_queries(); for (name, overrides) in &self.query_overrides { diff --git a/src/main.rs b/src/main.rs index 4f1322e25..fa8cee264 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,8 +3,7 @@ use std::{env, path::PathBuf}; use cargo_semver_checks::{ - GlobalConfig, PackageSelection, QueryOverride, ReleaseType, Rustdoc, ScopeSelection, - SemverQuery, + GlobalConfig, PackageSelection, ReleaseType, Rustdoc, ScopeSelection, SemverQuery, }; use clap::{Args, Parser, Subcommand}; diff --git a/src/query.rs b/src/query.rs index 36b4c9d1b..676ea6a72 100644 --- a/src/query.rs +++ b/src/query.rs @@ -81,11 +81,18 @@ impl LintLevel { } } +/// Configured values for a [`SemverQuery`] that differ from the lint's default. #[derive(Debug, Clone, Default)] pub struct QueryOverride { - /// the required version bump for this lint; see [`SemverQuery`].required_update + /// The required version bump for this lint; see [`SemverQuery`].`required_update`. + /// + /// If this is `None`, use the default `required_update` for the lint when calculating + /// the effective required version bump. pub required_update: Option, - /// the lint level for the query; see [`SemverQuery`].lint_level + /// The lint level for the query; see [`SemverQuery`].`lint_level`. + /// + /// If this is `None`, use the default `required_update` for the lint when calculating + /// the effective lint level. pub lint_level: Option, } @@ -102,7 +109,7 @@ pub struct SemverQuery { pub required_update: RequiredSemverUpdate, - /// The error level for when this lint procs (allow, warn, or deny) + /// The error level for when this lint occurs (allow, warn, or deny). pub lint_level: LintLevel, #[serde(default)]