Expand description
§lintel-check
Core validation engine for Lintel. Validates JSON, YAML, TOML, JSON5, and JSONC files against JSON Schema.
§Features
- Multi-format parsing — JSON, YAML, TOML, JSON5, JSONC with format-specific
$schemaextraction (inline properties, YAML modelines, TOML header comments) SchemaStorecatalog — auto-matches files to schemas using SchemaStorefileMatchpatterns- Schema caching — disk-backed cache for remote schemas with configurable cache directory
- Project configuration —
lintel.tomlwith exclude patterns, schema URI rewrites,//-relative paths, and per-file overrides - Rich diagnostics — miette-powered error reporting with source spans
§Usage
use lintel_check::validate::ValidateArgs;
let args = ValidateArgs {
globs: vec!["**/*.json".to_string()],
exclude: vec![],
cache_dir: None,
force_schema_fetch: false,
force_validation: false,
no_catalog: false,
config_dir: None,
schema_cache_ttl: None,
};
// Pass args and an HttpClient implementation to validate::run()§Configuration (lintel.toml)
root = true
exclude = ["vendor/**", "node_modules/**"]
[rewrite]
"https://json.schemastore.org/" = "//schemas/"
[[override]]
files = ["**/vector.json"]
schemas = ["**/vector.json"]
validate_formats = falseroot— stop walking up the directory tree for parent configsexclude— glob patterns to skip during validationrewrite— URI prefix replacement rules (longest prefix wins)//paths — resolve relative to the directory containinglintel.toml[[override]]— per-file/per-schema settings (e.g. disable format validation)
§License
Apache-2.0
Re-exports§
pub use lintel_config as config;pub use lintel_validation_cache as validation_cache;