This crate provides the core trait and types needed to build plugins for FSLint (part of file-soup). It defines the Plugin trait that all scanner plugins must implement.
use fslint_plugin_api::{Plugin, PluginContext, PluginResult, PluginMetadata, PluginError};
pub struct MyPlugin;
impl Plugin for MyPlugin {
fn metadata() -> PluginMetadata {
PluginMetadata {
name: "my-plugin".into(),
version: "0.1.0".into(),
description: "My custom file scanner".into(),
author: Some("Your Name".into()),
enabled_by_default: true,
}
}
fn check(&self, context: &PluginContext) -> Result<PluginResult, PluginError> {
// Your plugin logic here
Ok(PluginResult::active("my-plugin", "Found something"))
}
}| Type | Description |
|---|---|
|
The main trait all plugins implement |
|
Context passed to plugins (file path, metadata, etc.) |
|
Result returned by plugin checks |
|
Status enum: Active, Inactive, Alert, Warning, Error, Skipped |
|
Plugin name, version, description, author |
|
Error types for plugin operations |
-
fslint-plugin-sdk - SDK with helper utilities
-
file-soup - The main FSLint application
MIT OR Apache-2.0
See LICENSE-MIT for details.
Contributions welcome! Please read CONTRIBUTING.md first.