Skip to content

Commit

Permalink
lint & doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
suaviloquence committed Jun 3, 2024
1 parent f32df41 commit 879a060
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ impl GlobalConfig {
&self.query_overrides
}

#[must_use]
pub fn all_queries(&self) -> anyhow::Result<BTreeMap<String, SemverQuery>> {
let mut queries = SemverQuery::all_queries();
for (name, overrides) in &self.query_overrides {
Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
13 changes: 10 additions & 3 deletions src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RequiredSemverUpdate>,
/// 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<LintLevel>,
}

Expand All @@ -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)]
Expand Down

0 comments on commit 879a060

Please sign in to comment.