Skip to main content

register_lints

Macro register_lints 

Source
macro_rules! register_lints {
    ( @declare_structs $( ($pass_id:ident, $pass_type:ident, ($($lint:expr),* $(,)?) $(, $constructor:expr)? ) ),* $(,)? ) => { ... };
    ( @declare_consts $( ($pass_id:ident, $pass_type:ident, ($($lint:expr),* $(,)?) $(, $constructor:expr)? ) ),* $(,)? ) => { ... };
    ( @declare_funcs $( ($pass_id:ident, $pass_type:ident, $lints:tt $(, $constructor:expr)?) ),* $(,)? ) => { ... };
    (@register_early $registry:ident, $config:ident, $_pass_id:ident, late $(, $constructor:expr)?) => { ... };
    (@register_early $registry:ident, $config:ident, $_pass_id:ident, project $(, $constructor:expr)?) => { ... };
    (@register_early $registry:ident, $config:ident, $pass_id:ident, $_other:ident, $constructor:expr) => { ... };
    (@register_early $registry:ident, $config:ident, $pass_id:ident, $_other:ident) => { ... };
    (@register_late $registry:ident, $config:ident, $_pass_id:ident, early $(, $constructor:expr)?) => { ... };
    (@register_late $registry:ident, $config:ident, $_pass_id:ident, project $(, $constructor:expr)?) => { ... };
    (@register_late $registry:ident, $config:ident, $pass_id:ident, $_other:ident, $constructor:expr) => { ... };
    (@register_late $registry:ident, $config:ident, $pass_id:ident, $_other:ident) => { ... };
    (@register_project $registry:ident, $config:ident, $_pass_id:ident, early $(, $constructor:expr)?) => { ... };
    (@register_project $registry:ident, $config:ident, $_pass_id:ident, late $(, $constructor:expr)?) => { ... };
    (@register_project $registry:ident, $config:ident, $_pass_id:ident, both $(, $constructor:expr)?) => { ... };
    (@register_project $registry:ident, $config:ident, $pass_id:ident, $_other:ident, $constructor:expr) => { ... };
    (@register_project $registry:ident, $config:ident, $pass_id:ident, $_other:ident) => { ... };
    ( $($tokens:tt)* ) => { ... };
}
Expand description

Registers Solidity linter passes that can have both early and late variants.

§Parameters

Each pass is declared with:

  • $pass_id: Identifier of the generated struct that will implement the pass trait(s).
  • $pass_type: early, late, both, or project.
  • $lints: A parenthesized, comma-separated list of SolLint constants.
  • an optional constructor that receives the lint-specific configuration.

§Outputs

  • Marker structs for each linting pass.
  • const REGISTERED_LINTS containing all registered lint objects.
  • A function that adds fresh pass factories to Solar’s lint registry.