Module lint

Module lint 

Source
Expand description

Lint Engine for Seq

A clippy-inspired lint tool that detects common patterns and suggests improvements. Phase 1: Syntactic pattern matching on word sequences.

§Architecture

  • LintConfig - Parsed lint rules from TOML
  • Pattern - Compiled pattern for matching
  • Linter - Walks AST and finds matches
  • LintDiagnostic - Output format compatible with LSP

§Known Limitations (Phase 1)

  • No quotation boundary awareness: Patterns match across statement boundaries within a word body. Patterns like [ drop would incorrectly match [ followed by drop anywhere, not just at quotation start. Such patterns should be avoided until Phase 2 adds quotation-aware matching.

Structs§

CompiledPattern
A compiled pattern for efficient matching
LintConfig
Lint configuration containing all rules
LintDiagnostic
A lint diagnostic (match found)
LintRule
A single lint rule from configuration
Linter
The linter engine

Enums§

PatternElement
Element in a compiled pattern
Severity
Severity level for lint diagnostics

Statics§

DEFAULT_LINTS
Embedded default lint rules

Functions§

format_diagnostics
Format diagnostics for CLI output