Crate fast_yaml_linter

Crate fast_yaml_linter 

Source
Expand description

YAML linter with rich diagnostics

This crate provides a comprehensive YAML linting engine with:

  • Precise error location tracking (line, column, byte offset)
  • Rich diagnostic messages with source context
  • Pluggable rule system for extensibility
  • Multiple output formats (text, JSON, SARIF)

§Examples

use fast_yaml_linter::{Linter, TextFormatter, Formatter};

let yaml = r#"
name: John
age: 30
"#;

let linter = Linter::with_all_rules();
let diagnostics = linter.lint(yaml).unwrap();

let formatter = TextFormatter::new();
let output = formatter.format(&diagnostics, yaml);
println!("{}", output);

Re-exports§

pub use formatter::Formatter;
pub use formatter::TextFormatter;

Modules§

comment_parser
Comment detection and parsing utilities.
config
Rule configuration types and builders.
formatter
Diagnostic output formatters.
rules
Lint rules and rule registry.
source
Source code analysis and position mapping.
tokenizer
Flow collection tokenizer for identifying YAML syntax tokens.

Structs§

ContextLine
A single line of source context.
Diagnostic
A diagnostic message with location and context.
DiagnosticBuilder
Builder for creating diagnostics.
DiagnosticCode
Unique identifier for a diagnostic.
DiagnosticContext
Source code context for diagnostics.
LineMetadata
Pre-computed metadata about a line for efficient access.
LintConfig
Configuration for the linter.
LintContext
Shared caching layer for linting operations.
Linter
The main linter.
Location
A position in the source file.
SourceContext
Extracts source code context for diagnostics.
Span
A span of text in the source file.
Suggestion
A suggested fix for a diagnostic.

Enums§

LintError
Errors that can occur during linting.
Severity
Diagnostic severity levels.