Skip to content

Native abort when formatting a discovered config containing [[overrides]] #5

Closed

Description

@JounQin

Summary

format aborts the Node process when the discovered config (or overrideConfig) contains [[overrides]]. serde_tombi panics:

thread '<unnamed>' panicked at tombi/rust/serde_tombi/src/ser.rs:155:17:
internal error: entered unreachable code: Document must be valid TOML.
thread caused non-unwinding panic. aborting.

Environment

Reproduction

tombi.toml:

[format.rules]
indent-table-key-value-pairs = true
indent-width = 4

[[overrides]]
files.include = ["**/*.toml"]

[overrides.format.rules]
indent-width = 6
import { format } from 'tombit'
// a.toml lives next to tombi.toml
await format('[t]\nkey = 1\n', '/tmp/tombit-repro/a.toml')

What works / what aborts

call result
config: false ok
explicit config: { content, path } with [[overrides]] ok
discovery with [[overrides]] (no overrideConfig) abort
overrideConfig.overrides (or explicit config + any overrideConfig) abort

Notes

  • @tombi-toml/[email protected] formats the same config without crashing (with config: { content, path }).
  • The README says discovery includes [[overrides]] glob matching, so this should be supported.
  • It looks like the merged config is re-serialized and the formatter rejects the document, hitting unreachable!("Document must be valid TOML.") at serde_tombi/src/ser.rs:155.

Activity

  1. added 3 commits that reference this issue on Oct 19, 2026
    71defff
    c174f21
    ddbd2b4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions