Taplo

#Installation

There are currently no pre-built native binaries available for download.

#Native

You can install Taplo with the following command:

cargo install taplo-cli

After which the taplo binary should be available.

#Node.js

The tool can be either installed via Yarn:

yarn global add @taplo/cli

Or with NPM:

npm install -g @taplo/cli

Or simply run it with NPX:

npx @taplo/cli help

#Features

  • Linting
  • Validation (based on JSON schema)
  • Formatting

#Usage

The tool has nice usage and error messages thanks to clap, to list all the available options, simply run

taplo help

An example usage

taplo lint --schema taplo://taplo.toml taplo.toml

This command will lint the taplo.toml file with a built-in schema and report errors.

Or use schemas from the default repository:

taplo lint -S Cargo.toml

An example output:

error: conflicting dotted keys
--> Cargo.toml:9:1
|
9 | some.meta.value = 2
| ^^^^^^^^^^^^^^^ conflicting keys here
|
... Cargo.toml:10:1
|
10| some.meta = "meta"
| ^^^^^^^^^ already defined here
|
- entries sharing dotted keys cannot fully define intermediate tables and values
- make sure that the path consists of equal amount of keys to avoid conflicts
failure: processed 1 document with 1 error

The documentation here is non-exhaustive, for more options and settings, use the help command.

#Configuration

The tool supports a configuration file documented here.