Skip to main content

DiagnosticsConfig

Struct DiagnosticsConfig 

Source
pub struct DiagnosticsConfig {
    pub outdated_severity: DiagnosticSeverity,
    pub unknown_severity: DiagnosticSeverity,
    pub yanked_severity: DiagnosticSeverity,
    pub unsatisfiable_severity: DiagnosticSeverity,
    pub deprecated_severity: DiagnosticSeverity,
    pub mutable_ref_pin_severity: DiagnosticSeverity,
    pub mutable_ref_pin_enabled: bool,
    pub vulnerabilities_enabled: bool,
}
Expand description

Configuration for diagnostic severity levels.

Controls the severity level reported for different types of dependency issues. This allows users to customize whether issues appear as errors, warnings, hints, etc.

§Defaults

  • outdated_severity: HINT - Dependencies with available updates
  • unknown_severity: WARNING - Dependencies not found in registry
  • yanked_severity: WARNING - Dependencies using yanked versions
  • unsatisfiable_severity: WARNING - Dependencies whose requirement matches zero published versions
  • deprecated_severity: WARNING - Dependencies on a package the registry reports as deprecated/abandoned
  • mutable_ref_pin_severity: HINT - GitHub Actions uses: steps pinned to a mutable ref (tag) instead of a commit SHA
  • mutable_ref_pin_enabled: true - Whether the mutable-ref-pin diagnostic runs at all

§Examples

use deps_lsp::config::DiagnosticsConfig;
use tower_lsp_server::ls_types::DiagnosticSeverity;

let config = DiagnosticsConfig {
    outdated_severity: DiagnosticSeverity::INFORMATION,
    unknown_severity: DiagnosticSeverity::ERROR,
    yanked_severity: DiagnosticSeverity::ERROR,
    unsatisfiable_severity: DiagnosticSeverity::ERROR,
    deprecated_severity: DiagnosticSeverity::ERROR,
    mutable_ref_pin_severity: DiagnosticSeverity::ERROR,
    mutable_ref_pin_enabled: true,
    vulnerabilities_enabled: true,
};

assert_eq!(config.unknown_severity, DiagnosticSeverity::ERROR);

Fields§

§outdated_severity: DiagnosticSeverity§unknown_severity: DiagnosticSeverity§yanked_severity: DiagnosticSeverity§unsatisfiable_severity: DiagnosticSeverity§deprecated_severity: DiagnosticSeverity

Severity for a dependency on a package the registry reports as deprecated/abandoned (issue #205). No corresponding deprecated_enabled toggle: unlike vulnerabilities_enabled, this signal is derived from already-fetched data (zero new registry requests — see #205’s plan §1 D2), so a boolean would gate only string formatting, not a network call. Matches the severity-only precedent set by the four fields above.

§mutable_ref_pin_severity: DiagnosticSeverity

Severity for a GitHub Actions uses: step pinned to a mutable ref (a tag) instead of a full commit SHA (issue #473). Tunes loudness only; see mutable_ref_pin_enabled for the on/off toggle.

§mutable_ref_pin_enabled: bool

Whether the mutable-ref-pin diagnostic (issue #473) runs at all. Default true. Corrected during implementation review (spec 031 FR-009): unlike deprecated_severity, this diagnostic does need a real _enabled toggle — DiagnosticSeverity has no suppression value, and severity is never treated as a suppression input anywhere in this codebase, so without this boolean the diagnostic would be permanent and unremovable on every tag-pinned uses: step (the dominant pinning style), even for teams that intentionally reject SHA-pinning. Mirrors vulnerabilities_enabled’s exact shape.

§vulnerabilities_enabled: bool

Whether to run the OSV.dev vulnerability scan and render its diagnostics/hover content. Default true (opt-out): cargo audit/ npm audit run by default, and an opt-in gate would undercut the feature (approved Q5).

Implementations§

Source§

impl DiagnosticsConfig

Source

pub const fn to_severities(&self) -> DiagnosticSeverities

Converts this LSP-facing config into the deps-core DTO threaded through Ecosystem::generate_diagnostics.

§Examples
use deps_lsp::config::DiagnosticsConfig;

let config = DiagnosticsConfig::default();
let severities = config.to_severities();
assert_eq!(severities.outdated, config.outdated_severity);
assert_eq!(severities.unknown, config.unknown_severity);
assert_eq!(severities.yanked, config.yanked_severity);
assert_eq!(severities.unsatisfiable, config.unsatisfiable_severity);
assert_eq!(severities.deprecated, config.deprecated_severity);
assert_eq!(severities.mutable_ref_pin, config.mutable_ref_pin_severity);
assert_eq!(severities.mutable_ref_pin_enabled, config.mutable_ref_pin_enabled);

Trait Implementations§

Source§

impl Clone for DiagnosticsConfig

Source§

fn clone(&self) -> DiagnosticsConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DiagnosticsConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DiagnosticsConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DiagnosticsConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more