minie135/moonbit-sentinel/engine does not have a README file

    Category

    pub(all) enum Category {
    Metadata
    Source
    } derive(Eq, ToJson,
    Debug
    )

    Finding

    pub(all) struct Finding {
    rule : String
    severity : Severity
    category : Category
    file : String
    line : Int
    snippet : String
    message : String
    } derive(ToJson,
    Debug
    )

    RuleDef

    pub(all) struct RuleDef {
    id : String
    severity : Severity
    category : Category
    description : String
    } derive(ToJson,
    Debug
    )

    RuleDef::finding

    fn RuleDef::finding(self : RuleDef, file~ : String, line~ : Int, snippet~ : String, message~ : String) -> Finding

    RuleDoc

    pub(all) struct RuleDoc {
    id : String
    title : String
    category : String
    default_severity : String
    triggers : String
    example : String
    mitigation : String
    } derive(
    Debug
    )

    Severity

    pub(all) enum Severity {
    Low
    Medium
    High
    Critical
    } derive(Eq, ToJson,
    Debug
    )

    Severity::label

    fn Severity::label(self : Severity) -> String

    供字符串插值/终端输出使用的领域文本形式(Severity 不 derive Show)

    Severity::rank

    fn Severity::rank(self : Severity) -> Int

    Severity::weight

    fn Severity::weight(self : Severity) -> Int

    catalog_text

    fn catalog_text() -> String

    目录的稳定文本渲染(rules 子命令输出)

    parse_severity

    fn parse_severity(s : String) -> Severity?

    rule_by_id

    fn rule_by_id(id : String) -> RuleDoc?

    按 id 查找规则文档

    rules_catalog

    fn rules_catalog() -> Array[RuleDoc]

    全部规则的目录(与引擎实现一一对应)