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 only true spec violations asSeverity::Error, with optional-family problems surfaced as warnings and infos, never as rejections.lintis the opinionated companion:lint_bundlegoes beyond conformance and flags the hygiene issues a continuously-authored corpus drifts into, each finding tagged with a stable rule code.
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.
- validate
- Conformance checking against OKF v0.2.
Structs§
- Diagnostic
- A single finding about a bundle.
- Report
- The result of validating a bundle.
Enums§
- Severity
- Severity of a diagnostic.
Functions§
- lint_
bundle - Lints a loaded bundle, returning all findings.
- lint_
bundle_ at - Lints a bundle, additionally flagging concepts that are stale on
today. - validate_
bundle - Validates a loaded bundle, returning all findings.
- validate_
bundle_ at - Validates a bundle, additionally reporting concepts that are stale on
today.