Skip to main content

check

Macro check 

Source
macro_rules! check {
    ($category:expr, $success:expr $(, $field:ident : $value:expr )* $(,)?) => { ... };
    (@apply $builder:expr) => { ... };
    (@apply $builder:expr, $field:ident : $value:expr $(, $rest_field:ident : $rest_value:expr )* ) => { ... };
}
Expand description

Build an analyzer [Check] with required category/success and optional fields.

This macro wraps the existing builder API and keeps field assignment explicit. It accepts any builder method name as a field key (e.g. severity, message, context, uri, status_code, errors).

§Examples

use acorn::{check, analyzer::{CheckCategory, CheckSeverity}};

let ok = check!(CheckCategory::Prose, true, message: "doc-1");
let err = check!(
    CheckCategory::Readability,
    false,
    severity: CheckSeverity::Warning,
    message: "index.json",
    context: "12.1",
);