Expand description
Prelude module for convenient imports.
Importing everything from this module is the recommended way to use the SDK:
use nginx_lint_plugin::prelude::*;
// All core types are now available
let spec = PluginSpec::new("example", "test", "Example rule");
assert_eq!(spec.name, "example");This re-exports all core types (Plugin, PluginSpec, LintError, Fix,
Config, Directive, etc.), extension traits (ConfigExt, DirectiveExt),
the helpers module, and the export_component_plugin! macro.
Re-exports§
pub use super::helpers;
Macros§
- export_
component_ plugin - Macro to export a plugin as a WIT component
Structs§
- AllDirectives
With Context Iter - Iterator over all directives with their parent context.
- Argument
- A single argument to a directive.
- Block
- A brace-delimited block (
{ … }). - Comment
- A comment (# …)
- Config
- Root node of a parsed nginx configuration file.
- Directive
- A directive — either a simple directive (
listen 80;) or a block directive (server { … }). - Directive
With Context - A directive paired with its parent block context.
- Error
Builder - Builder for creating LintError with pre-filled rule and category
- Fix
- Represents a fix that can be applied to automatically resolve a lint error.
- Lint
Error - A lint error reported by a plugin.
- Plugin
Spec - Plugin metadata describing a lint rule.
- Position
- A position (line, column, byte offset) in the source text.
- Span
- A half-open source range defined by a start and end
Position.
Enums§
- Argument
Value - The kind and value of a directive argument.
- Config
Item - An item in the configuration (directive, comment, or blank line).
- Severity
- Severity level for lint errors
Constants§
- API_
VERSION - Current API version for the plugin SDK
Traits§
- Argument
Ext - Extension trait for Argument to add source reconstruction
- Config
Ext - Extension trait for
Configproviding iteration and include-context helpers. - Directive
Ext - Extension trait for
Directiveproviding inspection and fix-generation helpers. - Plugin
- Trait that all plugins must implement.