Expand description
Plugin system for linthis configuration management.
Plugins allow extending linthis with community or custom lint configurations,
additional rules, and shared presets. Plugins are Git repositories containing
a linthis-plugin.toml manifest.
§Features
- Git-based distribution: Plugins are fetched from Git repositories
- Local caching: Plugins are cached for offline use and faster startup
- Version pinning: Pin plugins to specific tags, branches, or commits
- Auto-sync: Optionally auto-update plugins on schedule
- Registry lookup: Use short names for well-known plugins
§Plugin Configuration
# .linthis/config.toml
[plugins]
sources = [
{ name = "official" }, # Registry lookup
{ name = "company", url = "https://github.com/co/plugin.git" }, # Direct URL
{ name = "pinned", url = "...", ref = "v1.0.0" }, # Pinned version
]§Plugin Manifest
Each plugin must contain a linthis-plugin.toml manifest:
[plugin]
name = "my-plugin"
version = "1.0.0"
description = "Custom lint rules for my project"
min_linthis_version = "0.1.0"
[config]
path = "config.toml" # Plugin's configuration file§CLI Commands
# Initialize plugins from config
linthis plugin init
# List installed plugins
linthis plugin list
# Update all plugins
linthis plugin update
# Clean plugin cache
linthis plugin clean§Module Structure
Re-exports§
pub use auto_sync::AutoSyncConfig;pub use auto_sync::AutoSyncManager;pub use cache::PluginCache;pub use config_manager::PluginConfigManager;pub use fetcher::PluginFetcher;pub use loader::PluginLoader;pub use manifest::PluginManifest;pub use registry::PluginRegistry;
Modules§
- auto_
sync - Auto-sync functionality for plugin updates.
- cache
- Plugin cache management.
- config_
manager - Configuration file manager for plugin add/remove operations.
- fetcher
- Plugin fetcher for cloning and updating Git repositories.
- loader
- Plugin configuration loader.
- manifest
- Plugin manifest parsing and validation.
- registry
- Plugin registry for resolving short names to Git URLs.
Structs§
- Plugin
Source - Plugin source specification from config or CLI
Enums§
- Plugin
Error - Plugin-specific errors
Functions§
- log_
plugin_ operation - Log a plugin operation if verbose mode is enabled