Tooling

Aside from the Jsonnet interpreters (which execute the Jsonnet code) these additional software tools allow you to get the most out of Jsonnet:

Formatter Demo

The formatter is a command-line utility bundled with the C++ build of Jsonnet. You can reformat files in place as so:

jsonnetfmt -i *.jsonnet

It will manage indenting and horizontal spacing within a line and remove excess vertical spacing. It will convert string literals, comments, fields and some operators into canonical forms as well as enforcing trailing commas. It will sort imports and remove excess nesting of parentheses. It will break lines in certain places.

output.jsonnet

Linter

The linter is another command-line utility bundled with the Go build of Jsonnet. You can check files as so:

jsonnet-lint file.jsonnet

Currently it is rudimentary and only checks for unused variables.

Bazel Jsonnet Rules

Jsonnet rules, provides the following rules to your Bazel build:

jsonnet_library
jsonnet_to_json
jsonnet_to_json_test