Deprecate define violation (#3358)

* Add `#[violation]` proc macro as a replacement for `define_violation!`

* Switch all rules to #[violation]
This commit is contained in:
konstin 2023-03-06 11:59:06 +01:00 committed by GitHub
parent 22e6778e17
commit 348a38d261
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
305 changed files with 4680 additions and 4635 deletions

View file

@ -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 {