Skip to main content

seqc/
lint.rs

1//! Lint Engine for Seq
2//!
3//! A clippy-inspired lint tool that detects common patterns and suggests improvements.
4//! Phase 1: Syntactic pattern matching on word sequences.
5//!
6//! # Architecture
7//!
8//! - `LintConfig` - Parsed lint rules from TOML
9//! - `Pattern` - Compiled pattern for matching
10//! - `Linter` - Walks AST and finds matches
11//! - `LintDiagnostic` - Output format compatible with LSP
12//!
13//! # Known Limitations (Phase 1)
14//!
15//! - **No quotation boundary awareness**: Patterns match across statement boundaries
16//!   within a word body. Patterns like `[ drop` would incorrectly match `[` followed
17//!   by `drop` anywhere, not just at quotation start. Such patterns should be avoided
18//!   until Phase 2 adds quotation-aware matching.
19
20mod linter;
21mod types;
22
23#[cfg(test)]
24mod tests;
25
26pub use linter::Linter;
27pub use types::{
28    CompiledPattern, DEFAULT_LINTS, LintConfig, LintDiagnostic, LintRule, MAX_NESTING_DEPTH,
29    PatternElement, Severity, format_diagnostics,
30};