Skip to content

Inline tables must be single line in TOML 1.0.0 #1590

@alec-bike

Description

@alec-bike

Summary

I just converted to prek.toml and also use tombi to format my TOML files. tombi enforces the TOML 1.0.0 spec that inline tables be single line. Seems like TOML 1.1.0 may have relaxed this requirement.

Using tombi lsp, I get an error inline-table-must-single-line when I try to split hooks over multiple lines (as shown in the prek documentation).

This is ok (but difficult to read):

[[repos]]
repo = "local"
hooks = [
  { id = "pytest", name = "pytest", entry = ".venv/bin/pytest -q", language = "system", types = [
    "python"
  ], pass_filenames = false },
]

This raises an error:

[[repos]]
repo = "local"
hooks = [
  {
    id = "pytest",
    name = "pytest",
    entry = ".venv/bin/pytest -q",
    language = "system",
    types = ["python"],
    pass_filenames = false,
  },
]
inline table must be single line in TOML v1.0.0 or earlier

Platform

macOS 26.3 M1

Version

0.3.2

.pre-commit-config.yaml

repos:

  - repo: local
    hooks:
      - id: pytest
        name: pytest
        entry: .venv/bin/pytest -q
        language: system
        types: [python]
        pass_filenames: false

Log file

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions