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 updatesunknown_severity:WARNING- Dependencies not found in registryyanked_severity:WARNING- Dependencies using yanked versionsunsatisfiable_severity:WARNING- Dependencies whose requirement matches zero published versionsdeprecated_severity:WARNING- Dependencies on a package the registry reports as deprecated/abandonedmutable_ref_pin_severity:HINT- GitHub Actionsuses:steps pinned to a mutable ref (tag) instead of a commit SHAmutable_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: DiagnosticSeveritySeverity 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: DiagnosticSeveritySeverity 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: boolWhether 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: boolWhether 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
impl DiagnosticsConfig
Sourcepub const fn to_severities(&self) -> DiagnosticSeverities
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
impl Clone for DiagnosticsConfig
Source§fn clone(&self) -> DiagnosticsConfig
fn clone(&self) -> DiagnosticsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiagnosticsConfig
impl Debug for DiagnosticsConfig
Source§impl Default for DiagnosticsConfig
impl Default for DiagnosticsConfig
Source§impl<'de> Deserialize<'de> for DiagnosticsConfig
impl<'de> Deserialize<'de> for DiagnosticsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DiagnosticsConfig
impl RefUnwindSafe for DiagnosticsConfig
impl Send for DiagnosticsConfig
impl Sync for DiagnosticsConfig
impl Unpin for DiagnosticsConfig
impl UnsafeUnpin for DiagnosticsConfig
impl UnwindSafe for DiagnosticsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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