ktrs-compose 0.5.0

Port of mrmans0n/compose-rules (the ktlint rule set `compose`) over the ktrs-lint engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Port of `ktlint/CompositionLocalAllowlistCheck.kt`.

use crate::ktlint::editor_config_properties::{COMPOSITION_LOCAL_ALLOWLIST_PROPERTY, ComposeProperty};
use crate::ktlint::ktlint_rule::KtlintRule;
use crate::rules::composition_local_allowlist::CompositionLocalAllowlist;

pub const CHECK: Option<fn() -> KtlintRule> = Some(composition_local_allowlist_check);

pub fn composition_local_allowlist_check() -> KtlintRule {
    KtlintRule::new(
        "compose:compositionlocal-allowlist",
        vec![ComposeProperty::String(&COMPOSITION_LOCAL_ALLOWLIST_PROPERTY)],
        Box::new(CompositionLocalAllowlist),
    )
}