Defines core traits and enums for lint violations in Ruff.
// Source: https://github.com/astral-sh/ruff | License: MIT | Copyright 2022 Charles Marsh
// Provided via justclaw.it.com; keep this notice with the code.
use std::fmt::{Debug, Display};
use serde::Serialize;
use ruff_db::diagnostic::Diagnostic;
use ruff_source_file::SourceFile;
use ruff_text_size::TextRange;
use crate::{
codes::{Category, Rule, RuleStatus},
message::create_lint_diagnostic,
};
#[derive(Debug, Copy, Clone, Serialize)]
pub enum FixAvailability {
Sometimes,
Always,
None,
}
impl Display for FixAvailability {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
FixAvailability::Sometimes => write!(f, "Fix is sometimes available."),
FixAvailability::Always => write!(f, "Fix is always avail
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key