Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 18 Oct 12:25
· 107 commits to main since this release

HOCON from C and Python, on Linux, macOS and Windows.

Added

  • libhocon, the C API in include/hocon.h: parse a file or a string, typed getters by path, a subtree as JSON or HOCON, errors with file, line, column and caret. A zip per platform on the release.
  • The zig-hocon Python package on libhocon: pyhocon's API, typed, safe to share between threads. Wheels for macOS, Linux (glibc and musl) and Windows on every Python from 3.10.
  • ParseOptions.resolve = false keeps every ${…} in the tree, for hocon.stringify to write back.
  • ParseOptions.ignore_unknown_fields = false makes a key the struct has no field for error.UnknownField.
  • hocon.parseFromSliceInDirLeaky reads text whose includes are relative to a directory; hocon.parseFromValue converts a hocon.Value you already have into your struct.

Fixed

  • A number read from text into a struct follows the JSON rules: 0x10, 1_000 and nan are errors, as in the spec and typesafe/config.

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 19 %
API and CLI 2 %
all of src/ 22 % of 7545 lines
conformance to the spec 99 % (442 of 445 tests)