mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:49:50 +00:00
Deprecate define violation (#3358)
* Add `#[violation]` proc macro as a replacement for `define_violation!` * Switch all rules to #[violation]
This commit is contained in:
parent
22e6778e17
commit
348a38d261
305 changed files with 4680 additions and 4635 deletions
|
@ -81,13 +81,12 @@ def main(*, name: str, code: str, linter: str) -> None:
|
|||
fp.write(
|
||||
"""use ruff_macros::derive_message_formats;
|
||||
|
||||
use ruff_macros::define_violation;
|
||||
use ruff_macros::violation;
|
||||
use crate::violation::Violation;
|
||||
use crate::checkers::ast::Checker;
|
||||
|
||||
define_violation!(
|
||||
pub struct %s;
|
||||
);
|
||||
#[violation]
|
||||
pub struct %s;
|
||||
impl Violation for %s {
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue