mirror of
https://github.com/astral-sh/ruff
synced 2026-01-10 16:15:19 -05:00
Introduce a ruff_diagnostics crate (#3409)
## Summary This PR moves `Diagnostic`, `DiagnosticKind`, and `Fix` into their own crate, which will enable us to further split up Ruff, since sub-linter crates (which need to implement functions that return `Diagnostic`) can now depend on `ruff_diagnostics` rather than Ruff.
This commit is contained in:
@@ -6,6 +6,10 @@ edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
ruff = { path = "../ruff" }
|
||||
ruff_cli = { path = "../ruff_cli" }
|
||||
ruff_diagnostics = { path = "../ruff_diagnostics" }
|
||||
|
||||
anyhow = { workspace = true }
|
||||
clap = { workspace = true }
|
||||
itertools = { workspace = true }
|
||||
@@ -13,8 +17,6 @@ libcst = { workspace = true }
|
||||
once_cell = { workspace = true }
|
||||
pretty_assertions = { version = "1.3.0" }
|
||||
regex = { workspace = true }
|
||||
ruff = { path = "../ruff" }
|
||||
ruff_cli = { path = "../ruff_cli" }
|
||||
rustpython-common = { workspace = true }
|
||||
rustpython-parser = { workspace = true }
|
||||
schemars = { workspace = true }
|
||||
|
||||
@@ -11,7 +11,7 @@ use strum::IntoEnumIterator;
|
||||
use ruff::registry::{Linter, Rule, RuleNamespace};
|
||||
use ruff::settings::options::Options;
|
||||
use ruff::settings::options_base::ConfigurationOptions;
|
||||
use ruff::AutofixAvailability;
|
||||
use ruff_diagnostics::Availability;
|
||||
|
||||
use crate::ROOT_DIR;
|
||||
|
||||
@@ -39,8 +39,8 @@ pub fn main(args: &Args) -> Result<()> {
|
||||
|
||||
if let Some(autofix) = rule.autofixable() {
|
||||
output.push_str(match autofix.available {
|
||||
AutofixAvailability::Sometimes => "Autofix is sometimes available.",
|
||||
AutofixAvailability::Always => "Autofix is always available.",
|
||||
Availability::Sometimes => "Autofix is sometimes available.",
|
||||
Availability::Always => "Autofix is always available.",
|
||||
});
|
||||
output.push('\n');
|
||||
output.push('\n');
|
||||
|
||||
Reference in New Issue
Block a user