Expand description
Cha Plugin SDK — toolkit for building Cha WASM analyzer plugins.
§Usage
Cargo.toml:
[lib]
crate-type = ["cdylib"]
[dependencies]
cha-plugin-sdk = { git = "https://github.com/W-Mai/Cha" }
wit-bindgen = "0.55"src/lib.rs:
ⓘ
cha_plugin_sdk::plugin!(MyPlugin);
struct MyPlugin;
impl Guest for MyPlugin {
fn name() -> String { "my-plugin".into() }
fn analyze(input: AnalysisInput) -> Vec<Finding> { vec![] }
}Macros§
- is_
smell_ disabled - Returns true if
smell_nameappears in the host-provided disabled-smells list (option key__disabled_smells__, a list-str). Use at the top of each smell check inanalyze()to short-circuit disabled work. - option_
bool - Extract a boolean option by key.
- option_
float - Extract a float option by key.
- option_
int - Extract an integer option by key.
- option_
list_ str - Extract a string list option by key.
- option_
str - Extract a string option by key from
analysis-input.options. - plugin
- Set up bindings and export a plugin implementation.
- str_
options - Iterate all string options as
(key, value)pairs.
Constants§
- DISABLED_
SMELLS_ KEY - Key used by the host to pass the list of smell names the plugin should skip
emitting for this analysis call. Check via
is_smell_disabled!.