Skip to content

v0.3.0

Choose a tag to compare

@lejmr lejmr released this 18 Oct 12:53
· 126 commits to main since this release

The rest of the spec, durations and sizes, and three new commands.

Added

  • hocon.Duration, hocon.Period and hocon.Size, read from 30s, 3 months, 512MiB in any unit the spec lists.
  • Objects with numeric keys ({ "0": a, "1": b }) read as lists, into a slice or an array.
  • hocon get prints one value, hocon check reads files, with --schema into your own struct, and hocon diff compares two files as they resolve.

Changed

  • Nesting deeper than 500, or a chain of 500 substitutions, is error.TooDeep instead of a stack overflow.
  • An included .properties file has to be UTF-8.

Fixed

442 of the 445 tests in the conformance suite pass, up from 437.

  • The file --env=keep writes reads back to the same result when a substitution comes from an include inside a block, and a += still waiting on the environment is written as +=.
  • A lone surrogate in a quoted string ("\ud83d") is kept and written back as it was read.
  • A + in a run that is no number is an error.
  • An optional substitution that closes a cycle finds nothing.
  • A key written many times merges in linear time.

How much of the code in src/ is written by hand, the rest with AI, counted with git blame over the lines that are not empty, by who wrote the commit each line comes from; moved code stays its author's. The tests are left out: most of them are written with AI.

share
Tokenizer 73 %
AST 51 %
Value 15 %
Config 20 %
API and CLI 3 %
all of src/ 24 % of 6880 lines
conformance to the spec 99 % (442 of 445 tests)