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:
@@ -79,10 +79,9 @@ def main(*, name: str, code: str, linter: str) -> None:
|
||||
# Add the relevant rule function.
|
||||
with (rules_dir / f"{rule_name_snake}.rs").open("w") as fp:
|
||||
fp.write(
|
||||
"""use ruff_macros::derive_message_formats;
|
||||
"""use ruff_macros::{derive_message_formats, violation};
|
||||
use ruff_diagnostics::Violation;
|
||||
|
||||
use ruff_macros::violation;
|
||||
use crate::violation::Violation;
|
||||
use crate::checkers::ast::Checker;
|
||||
|
||||
#[violation]
|
||||
|
||||
Reference in New Issue
Block a user