Skip to content

v0.3.0

Latest

Choose a tag to compare

@senanurcetin senanurcetin released this 20 Nov 07:28
· 6 commits to main since this release
08e478f

Added

  • --report-all for jsonl_utf8_guard.py: keeps scanning past the first invalid line and prints one JSON summary, {"status": "invalid", "records": N, "errors": [{"line": L, "reason": "..."}], "truncated": false, "max_bytes": ...}, exit code 2. At most MAX_REPORTED_ERRORS (100) errors are listed and "truncated": true marks a longer list; records counts valid objects across the whole file. An over-long line is still rejected before decoding and is drained in fixed-size chunks so later lines can be checked. The default single-error behavior, messages and exit codes are unchanged (#33).

Fixed

  • Non-object JSONL records name their JSON type without including input values: Line N: expected a JSON object, got an array (also a string, a number, true, false, null) (#47).
  • --max-bytes is validated by argparse, so 0 and negative values are a usage error naming the argument (must be a positive integer, got 0, exit 2) instead of a Validation failed: line that read like bad input. The library check in iter_jsonl_records is unchanged for direct callers; a non-number keeps argparse's own message (#41).
  • Rejections that already had their own cause now say so instead of the generic invalid JSON: a repeated object key reports Line N: duplicate JSON object key, and NaN / Infinity / -Infinity report Line N: non-finite number (NaN or Infinity) is not allowed. Neither message includes the key or any record content; real parse errors keep invalid JSON (#40).

Thanks to @rise11hx-cmyk and @jwalith4418-Mj for this release.