Expand description
§okf-validator: conformance checking and linting for OKF bundles
Companion to okf-core, the pure-Rust
implementation of the Open Knowledge Format (OKF) v0.2. This crate
judges bundles; okf-core models them.
validatechecks conformance:validate_bundlereports true spec violations asSeverity::Error, and material data integrity issues, temporal checks, broken references, contract discrepancies, and script syntax errors asSeverity::WarningorSeverity::Info.lintis the opinionated companion:lint_bundleevaluates 12 bundle formatting, structure, and authoring hygiene rules, each finding tagged with a stable rule code (L1..L12).syntaxprovides in-process syntax checking for Python, JavaScript, TypeScript, Rust, SQL, JSON, YAML, and Bash.
Staleness checks depend on the wall clock, so they are opt-in via
validate_bundle_at and lint_bundle_at, which take the date to
compare against; the plain variants are deterministic.
Most users get this crate through the okf crate,
which re-exports it alongside okf-core and ships the okf CLI.
use okf_core::Bundle;
use okf_validator::validate_bundle;
let bundle = Bundle::load("./my_bundle")?;
let report = validate_bundle(&bundle);
if report.is_conformant() {
println!("conformant OKF v0.2 bundle");
}Modules§
- lint
- Opinionated bundle health checks, beyond conformance and validation.
- syntax
- Multi-language syntax validation for Attested Computations and embedded scripts.
- validate
- Conformance checking and structural validation against OKF v0.2.
Structs§
- Diagnostic
- A single finding about a bundle.
- Fenced
Code Block - A parsed fenced code block from markdown.
- Parse
Severity Error - Error returned when a string cannot be parsed into a
Severity. - Report
- The result of validating a bundle.
- Syntax
Error - A syntax diagnostic produced by static AST parsing.
Enums§
Functions§
- check_
syntax - Checks the syntax of
sourcefor the givenlanguagetag or name. - extract_
fenced_ code_ blocks - Extracts all fenced code blocks (delimited by 3+ backticks or 3+ tildes) from markdown text.
- lint_
bundle - Lints a loaded bundle, returning all findings.
- lint_
bundle_ at - Lints a bundle, returning all opinionated formatting and style findings.
- validate_
bundle - Validates a loaded bundle, returning all findings.
- validate_
bundle_ at - Validates a bundle, additionally reporting concepts that are stale on
today.