Skip to main content

Module diff

Module diff 

Source
Expand description

jss-lint diff engine + renderers — mirrors texlint/diff.py (spec 016). Pure comparison over the spec-001 --output json shape; violations are kept as generic serde_json::Value objects (not this crate’s typed Violation) since a diff input can be any spec-001-shaped JSON file, including ones this binary didn’t produce, and every original field must round-trip into render_json’s output untouched.

Structs§

DiffReport
Mirrors diff.py::DiffReport.
SchemaMismatch
Mirrors diff.py::SchemaMismatch.

Functions§

compare
Compares two spec-001 violation lists. Mirrors diff.py::compare (spec 016 contract C-2). rule_renames isn’t exposed by the jss-lint diff CLI surface today (Python’s diff_cmd doesn’t wire a --rule-renames flag either) — kept as a parameter for API parity with the Python function.
render_json
Deterministic JSON output. Mirrors diff.py::render_json, reusing json_output::write_value for the same json.dumps-compatible serialization.
render_markdown
GitHub-flavoured CommonMark. Mirrors diff.py::render_markdown.
render_terminal
ANSI-free plain-text rendering. Mirrors diff.py::render_terminal.
validate_payload
Validates a parsed JSON payload against the spec-001 shape and returns its violations array. source is a short human-readable identifier (typically a file path) included in the error message. Mirrors diff.py::validate_payload.