From 011dd1ab96293dbbfdae50ad98a7f3f0f117eaa9 Mon Sep 17 00:00:00 2001 From: Florian Bartels Date: Fri, 28 Oct 2022 10:13:08 +0200 Subject: [PATCH] Enforce order of any `s_*!` macro call Before this change, only the order of `s!` was checked. After, it also checks `s_no_extra_traits!` and `s_paren!`. Only the order is checked, not the number of calls. This is required because multiple calls have to be allowed. --- ci/style.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci/style.rs b/ci/style.rs index 07b2a754bc343..31adeae4fbde7 100644 --- a/ci/style.rs +++ b/ci/style.rs @@ -142,6 +142,12 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) { } else if line.starts_with("s! {") { s_macros += 1; State::Structs + } else if line.starts_with("s_no_extra_traits! {") { + // multiple macros of this type are allowed + State::Structs + } else if line.starts_with("s_paren! {") { + // multiple macros of this type are allowed + State::Structs } else if line.starts_with("f! {") { f_macros += 1; State::FunctionDefinitions