Skip to content

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 16 Sep 02:33
· 268 commits to main since this release
f1a1a80

jz holds every reading of an input to the same rules. A stream is
identified under the record limit it is read under and drops a file path
that does not fit, the way a whole document does; a JSON escape that
names no character and a control character standing in YAML text are
refused rather than replaced; YAML nests as deeply as JSON. A table can
ask for its rows to be counted instead of letting the last column take
the rest of the line, jz test --json writes what failed as one object,
and loading the registry costs a tenth less time and a fifth fewer
allocations. The registry is unchanged at 224 commands and 596
definitions.

Added

  • jz test --json writes the result to standard output as one object:
    the counts, and a failure per entry with the definition, the case, the
    fixture path, the registry it came from, what it failed at and the
    message. The kinds are load, select, parse, refuse, stream, unread,
    schema and golden, so a job can tell one failure from another without
    matching the message. The lines on standard error and the exit status
    are the same with the option as without.

Changed

  • max_fields of a table may be one more than the number of columns,
    which is how a definition asks for a row to be counted rather than for
    its last column to take the rest of the line. ps aux keeps the
    default; proc/diskstats now counts every row, where a twenty-first
    field used to be caught only by failing to convert to an integer in
    the last column.
  • Loading the registry costs about a tenth less time, a tenth fewer
    bytes and a fifth fewer allocations. The walk that looks for
    definitions no longer descends into the fixtures beside them (5,614
    files were read through to find 596), a definition file is read into
    one buffer of its own length, and the YAML reader takes its nodes from
    blocks, leaves text with no CRLF in it where it lies and does not
    build a scalar written on one line. Nothing about what is chosen, what
    is reported or which registry wins changes.

Fixed

  • The examples that append to an array are quoted, in the README, the
    usage guide, the cookbook, jz new --help and the demo recording.
    jz new tags[]=web copied into zsh, which is what macOS starts with,
    was refused by the shell with no matches found before jz saw it.
  • --stream holds the lines it identifies the format by to the 1 MiB
    record limit that the reading of a record already applied, so a
    producer that never ends a record is refused at the byte past the
    limit with exit 3 instead of waited for. Two megabytes with no line
    break were refused at once with --define and waited for with
    --parser df --variant gnu.
  • --stream --file drops a file path that named a definition the text
    does not fit, the way the whole-document reading does, and reads the
    text on its own terms. A df report saved as /etc/fstab was exit 4
    with --stream and exit 0 without it.
  • Input that cannot be read at all, such as a gzip file whose checksum
    does not match, ends --stream with the status the whole-document
    reading ends with: exit 3 rather than exit 1.
  • A \u escape naming half of a surrogate pair in JSON or JSON Lines is
    refused with the line it is on, where it was read as U+FFFD and
    written out with exit 0: {"name":"\ud800"} became {"name":"\ufffd"}.
    A pair written in full and a replacement character the text holds for
    itself are unchanged.
  • A control character standing in YAML text is refused, as YAML 1.2.2
    does not allow it there. key: ab<NUL>cd was read as a value holding
    it. One written as an escape ("a\0b") is still a character of the
    value.
  • YAML nests as deeply as JSON: both are held to 1000 levels of arrays
    and objects, where YAML stopped at 100 and counted a scalar as a
    level.
  • JSON, JSON Lines, YAML, LTSV, lines and nul input, read with
    --format, a file's extension or jz new key:=@file, is held to the
    4,194,304 values a csv and a definition's reading were already held to:
    a JSON array of 4,194,305 numbers was read with exit 0. Past the limit
    a whole reading is exit 3 with nothing written. A stream counts each
    record, and a record past the limit is a record that cannot be read,
    with the records before it kept.
  • jz new counts the values of the whole document it makes, so files each
    under the limit cannot make one past it. --each counts each document
    and treats one past the limit as a line that cannot be read.
  • jz new reports a file or standard input past the 64 MiB limit with
    exit 3, as --file does, where it was exit 1.
  • Without --extract or --exclude, output is no longer copied object by
    object, and no option remembers every key it has seen: a stream of JSON
    Lines whose records each have keys of their own grew from 23 MiB to
    162 MiB of memory between 100,000 and 1,000,000 records, and now stays
    at 12 MiB with or without the options. A refusal of an unknown key
    names at most 64 of the keys the input had.