taplo TOML "expected" syntax error in CI
taplo lint parses TOML and reports "expected ..." when it reaches a token that does not fit the grammar, for example a value that is not quoted, a missing bracket, or an equals sign out of place.
What this error means
taplo lint (or taplo check) exits non-zero with an "expected ..." message and a line:col span pointing at the invalid TOML.
error: expected value
┌─ pyproject.toml:5:10
│
5 │ name = my package
│ ^^^^^^^^^^ expected valueCommon causes
An unquoted string value
TOML strings must be quoted; name = my package is invalid because a bare multi-word value is not a value.
A malformed table header or missing bracket
A [section without its closing bracket, or a stray token, makes the parser expect something it does not find.
How to fix it
Quote strings and close brackets
- Go to the line:col taplo printed.
- Quote string values and balance any
[ ]table headers. - Re-run
taplo lintto confirm.
# wrong
name = my package
# right
name = "my package"Format with taplo to normalize syntax
Once it parses, taplo fmt normalizes spacing and quoting so style stays consistent.
taplo fmt pyproject.tomlHow to prevent it
- Run
taplo lintin a pre-commit hook for.tomlfiles. - Always quote TOML string values.
- Format with
taplo fmtto keep syntax consistent.