Expand description
Core types for the lint engine: rule definitions, error reporting, and fix proposals.
This module contains the fundamental abstractions used by both native Rust
rules (in src/rules/) and WASM plugin rules:
Structs§
- Fix
- Represents a fix that can be applied to resolve a lint error
- FixApply
Result - Result of applying fixes to content, with detailed counts.
- Lint
Error - A single lint diagnostic produced by a rule.
- Linter
- Container that holds
LintRules and runs them against a parsed config.
Enums§
- Severity
- Severity level of a lint diagnostic.
Constants§
- RULE_
CATEGORIES - Display-ordered list of rule categories for UI output.
Traits§
- Lint
Rule - A lint rule that can be checked against a parsed nginx configuration.
Functions§
- apply_
fixes_ to_ content - Apply fixes to content string.
- apply_
fixes_ to_ content_ detailed - Apply fixes to content string, reporting skipped fixes.
- compute_
line_ starts - Compute the byte offset of the start of each line (1-indexed).
- normalize_
line_ fix - Convert a line-based
Fixinto an offset-based one using precomputed line starts. - run_
rule - Run a single rule, dispatching to
LintRule::check_sharedwith one lazily-createdArc<Config>for rules that want a shared handle, and toLintRule::checkotherwise. - run_
rule_ with_ content - Like
run_rule, but additionally dispatches toLintRule::check_with_contentfor rules that want raw content, so those rules don’t have to re-read the file from disk when the caller already has it in memory. Falls back torun_rule’s dispatch policy otherwise.