1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! # okf-validator: conformance checking and linting for OKF bundles
//!
//! Companion to [`okf-core`](https://docs.rs/okf-core), the pure-Rust
//! implementation of the [Open Knowledge Format (OKF) v0.2][spec]. This crate
//! judges bundles; okf-core models them.
//!
//! - [`validate`] checks conformance: [`validate_bundle`] reports true spec
//! violations as [`Severity::Error`], and material data integrity issues,
//! temporal checks, broken references, contract discrepancies, and script syntax
//! errors as [`Severity::Warning`] or [`Severity::Info`].
//! - [`lint`] is the opinionated companion: [`lint_bundle`] evaluates 12
//! bundle formatting, structure, and authoring hygiene rules, each finding tagged with a stable rule code (`L1`..`L12`).
//! - [`syntax`] provides in-process syntax checking for Python,
//! JavaScript, TypeScript, Rust, SQL, JSON, YAML, and Bash.
//!
//! # Cargo features
//!
//! The four third-party language parsers are optional and on by default:
//! `python` (`rustpython-parser`), `javascript` (`oxc_parser`, also covers
//! TypeScript), `rust` (`syn`), and `sql` (`sqlparser`). Conformance
//! validation and linting need none of them; only the two syntax checks do.
//! Disable a feature and [`check_syntax`] accepts that language unchecked,
//! exactly as it does for an unknown tag. This matters most for `python`,
//! whose parser depends on the LGPL-3.0-only `malachite` crates: a consumer
//! under an allow-list licence policy can take
//! `default-features = false, features = ["sql"]` and keep everything else.
//! JSON, YAML, and Bash checking is built in.
//!
//! 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`](https://docs.rs/okf) crate,
//! which re-exports it alongside okf-core and ships the `okf` CLI.
//!
//! ```no_run
//! 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");
//! }
//! # Ok::<(), okf_core::BundleError>(())
//! ```
//!
//! [spec]: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/main/SPEC.md
// Pedantic and nursery lints keep the published crate tidy; the few cases
// where a lint is genuinely wrong for this codebase are silenced inline with a
// justification.
pub use ;
pub use ;
pub use ;