tomllint - Man Page
check TOML files for syntax errors
Synopsis
Description
tomllint checks one or more files for TOML syntax errors using Python's built-in TOML parser. It writes diagnostics to standard error and is silent when every input is valid unless verbose mode is enabled.
When the sole toml_file operand is -, tomllint reads TOML from standard input and uses <stdin> as the diagnostic filename. When supplied alongside other operands, - is treated as a literal filename.
Options
- -h, ā--help
Show a usage summary and exit.
- -v, ā--verbose
Write an informational diagnostic for each input that passes validation.
Exit Status
- 0
Every input contains valid TOML, or help was requested.
- 1
At least one input contains invalid TOML or could not be opened.
- 2
The command line is invalid, such as when no input is supplied.
Diagnostics
TOML syntax errors use the following form:
filename:line:column: error: message
Files that cannot be opened use line and column zero:
filename:0:0: error: reason
With --verbose, successful inputs produce:
filename:1:1: info: linted successfully
Examples
Check one file:
tomllint pyproject.toml
Check multiple files:
tomllint pyproject.toml config.toml
Check standard input:
tomllint -
Report successful validation:
tomllint --verbose pyproject.toml