mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-01 04:18:05 +00:00
Use a derive macro for Violations (#14557)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
6fd10e2fe7
commit
14ba469fc0
629 changed files with 2555 additions and 2562 deletions
|
|
@ -93,7 +93,7 @@ def main(*, name: str, prefix: str, code: str, linter: str) -> None:
|
|||
fp.write(
|
||||
f"""\
|
||||
use ruff_diagnostics::Violation;
|
||||
use ruff_macros::{{derive_message_formats, violation}};
|
||||
use ruff_macros::{{derive_message_formats, ViolationMetadata}};
|
||||
|
||||
use crate::checkers::ast::Checker;
|
||||
|
||||
|
|
@ -108,8 +108,8 @@ use crate::checkers::ast::Checker;
|
|||
/// Use instead:
|
||||
/// ```python
|
||||
/// ```
|
||||
#[violation]
|
||||
pub struct {name};
|
||||
#[derive(ViolationMetadata)]
|
||||
pub(crate) struct {name};
|
||||
|
||||
impl Violation for {name} {{
|
||||
#[derive_message_formats]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue