Crate nginx_lint_common

Crate nginx_lint_common 

Source
Expand description

Core types shared between the nginx-lint CLI and WASM plugins.

This crate provides the foundational types used throughout the nginx-lint ecosystem: lint rule definitions, error reporting, configuration management, and ignore comment support.

§Modules

§Quick reference

TypePurpose
LintRuleTrait that every lint rule (native or WASM) implements
LintErrorA single lint diagnostic with location, severity, and optional fixes
SeverityError or Warning
FixAn auto-fix action (replace, delete, insert)
LintConfigSettings loaded from .nginx-lint.toml
LinterContainer that holds rules and runs them against a parsed config

§Re-exports

The [parser] module re-exports the entire [nginx_lint_parser] crate, giving access to parse_config, parse_string, and the AST types.

Re-exports§

pub use config::Color;
pub use config::ColorConfig;
pub use config::ColorMode;
pub use config::IncludeConfig;
pub use config::LintConfig;
pub use config::PathMapping;
pub use config::ValidationError;
pub use docs::RuleDoc;
pub use docs::RuleDocOwned;
pub use ignore::FilterResult;
pub use ignore::IgnoreTracker;
pub use ignore::IgnoreWarning;
pub use ignore::filter_errors;
pub use ignore::parse_context_comment;
pub use linter::Fix;
pub use linter::LintError;
pub use linter::LintRule;
pub use linter::Linter;
pub use linter::RULE_CATEGORIES;
pub use linter::Severity;
pub use linter::apply_fixes_to_content;
pub use linter::compute_line_starts;
pub use linter::normalize_line_fix;
pub use nginx_lint_parser as parser;

Modules§

config
Configuration management for nginx-lint.
docs
Rule documentation types for nginx-lint
ignore
Ignore comment support for nginx-lint
linter
Core types for the lint engine: rule definitions, error reporting, and fix proposals.

Functions§

parse_config
Parse a nginx configuration file from disk
parse_string
Parse nginx configuration from a string
parse_string_with_errors
Parse nginx configuration from a string, returning AST even when syntax errors exist.