Macro marker_api::declare_lint
source · macro_rules! declare_lint { ( $(#[doc = $doc:literal])+ $NAME: ident, $LEVEL: ident $(,)? ) => { ... }; ( $(#[doc = $doc:literal])+ $NAME: ident, $LEVEL: ident, $REPORT_IN_MACRO: expr $(,)? ) => { ... }; }
Expand description
This macro creates a new lint instance. The doc comment of the lint will be available in the crate documentation and any documentation generated by Marker. The content will be rendered with Markdown.
It’s recommended to include a section explaining what the lint does, and an example. You can also provide additional information, like “limitations” or “known problems”. Here is a recommended template:
marker_api::declare_lint!{
/// # What it does
/// Here you can describe what your lint does.
///
/// # Example
/// ```
/// <bad example>
/// ```
///
/// Use instead
/// ```
/// <bad example>
/// ```
ITEM_WITH_TEST_NAME,
Warn,
}