Skip to content

fix(fmt): keep multiline inline tables intact - #14670

Merged
jdx merged 2 commits into
mainfrom
claude/mise-discussion-14667-b5df3b
Oct 18, 2026
Merged

jdx merged 2 commits into
mainfrom
claude/mise-discussion-14667-b5df3b

Conversation

@jdx

@jdx jdx commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

https://entire.io/gh/jdx/mise/trails/874

mise fmt mangled multiline inline tables (TOML 1.1). Comments inside them were hoisted out of the table, and entries after the first lost their indentation. Reported in discussion 14667.

Before, for this config:

[bootstrap.macos.launchd.agents]
# Use the 1Password SSH agent with any SSH client
SSH_AUTH_SOCK = {
  program = "/bin/sh",
  args = ["-c", "true"],
  run_at_load = true,
}

mise fmt produced:

# Use the 1Password SSH agent with any SSH client
[bootstrap.macos.launchd.agents]
SSH_AUTH_SOCK = {
  program = "/bin/sh",
args = ["-c", "true"],
run_at_load = true,
}

(the comment also moved to after the closing brace in the reporter's larger example). Now the table is left exactly as written, and the rest of the file is still formatted and sorted as before.

The cause is in taplo, which rebuilds inline tables without their newlines. mise fmt now replaces each multiline inline table with a placeholder string before running taplo and restores the original text afterwards. Single-line inline tables are formatted as before. Multiline tables are preserved verbatim rather than reformatted.

Tested with a new unit test using the reporter's config (output must equal input); cargo test --bin mise cli::fmt and cargo clippy --bin mise --all-targets -- -D warnings pass.

Thanks to @ponko2 for the report.

🤖 Generated with Claude Code

AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: claude-code_2-1-299_agent.


Note

Low Risk
Changes only affect mise fmt output, not config loading or runtime behavior; placeholder collision is guarded by a unique prefix.

Overview
mise fmt no longer destroys multiline inline tables (TOML 1.1). taplo was collapsing them to a single line, which broke indentation and pulled comments out of the table.

The formatter now stashes each multiline inline table (and arrays that contain one) as a unique placeholder string, runs the existing taplo pass via a new format_with_taplo helper, then restores the original table text. Single-line inline tables are still normalized by taplo as before.

Unit tests assert round-trip equality for reporter-style configs, single-line tables with decor-only newlines, and multiline tables inside arrays.

Reviewed by Cursor Bugbot for commit ff256bd. Bugbot is set up for automated code reviews on this repo. Configure here.

taplo drops the newlines inside an inline table, so `mise fmt` moved
comments out of multiline inline tables and left their entries with
ragged indentation. Set those tables aside before taplo runs and put
them back verbatim.

Fixes discussion 14667.

Co-authored-by: ponko2 <901860+ponko2@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M57HG4ZKBSKKS6HVSVG3J4CS
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1466b9bd-f470-4250-9112-c1c84bb3056d
📥 Commits

Reviewing files that changed from the base of the PR and between 4330d64 and ff256bd.

📒 Files selected for processing: 1
  • src/cli/fmt.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

mise fmt preserves multiline inline tables while letting taplo format the rest of the document.

  • mise fmt keeps multiline inline tables intact while formatting the rest of a config.

No actionable new issues were found. Tests were inspected but not run.

Reviews (2) · Last reviewed commit: "fix(fmt): stash only the table's own tex..." · Reviewed by Greptile

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8896e9f. Configure here.

Comment thread src/cli/fmt.rs Resolved
Comment thread src/cli/fmt.rs Resolved
…ltiline tables

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M57J61DW4RW58DY3N26A1MGR
@jdx
jdx merged commit fb34f22 into main Oct 18, 2026
48 checks passed
@jdx
jdx deleted the claude/mise-discussion-14667-b5df3b branch October 18, 2026 16:02
mise-en-dev added a commit that referenced this pull request Oct 19, 2026
<!-- entire-trail-link-start -->
https://entire.io/gh/jdx/mise/trails/879
<!-- entire-trail-link-end -->

### 🚀 Features

- **(backend)** serve every backend's version list from the versions
host by @jdx in [#14700](#14700)
- **(bootstrap)** add --prune-dotfiles to remove orphaned dotfiles by
@jdx in [#14681](#14681)
- **(config)** add read_json, read_yaml and read_toml template functions
by @jdx in [#14705](#14705)
- **(config)** apply the default minimum_release_age to every backend by
@jdx in [#14701](#14701)
- **(dotfiles)** add dotfiles.windows_symlinks to link files instead of
copying on Windows by @jdx in
[#14682](#14682)
- **(dotnet)** add lts and sts version aliases by @jdx in
[#14683](#14683)
- **(http)** read release dates for http versions by @jdx in
[#14696](#14696)
- **(install)** add a PowerShell installer at mise.run/powershell by
@jdx in [#14660](#14660)
- **(task)** add -a as a short alias for tasks --all by @williamsjokvist
in [#14674](#14674)
- **(vfox)** let plugins report release dates for minimum_release_age by
@jdx in [#14695](#14695)

### 🐛 Bug Fixes

- **(aqua)** find binaries in macOS universal archives by @jdx in
[#14665](#14665)
- **(aqua)** date github_tag versions so minimum_release_age applies by
@jdx in [#14691](#14691)
- **(backend)** warn when minimum_release_age cannot check a version's
date by @jdx in [#14694](#14694)
- **(conda)** report release dates so minimum_release_age applies by
@jdx in [#14693](#14693)
- **(core)** date dotnet, deno and erlang versions for
minimum_release_age by @jdx in
[#14692](#14692)
- **(core)** date more ruby, python and rust versions so
minimum_release_age applies by @jdx in
[#14697](#14697)
- **(dotfiles)** report copies instead of symlinks for symlink-each on
Windows by @jdx in [#14654](#14654)
- **(fmt)** keep multiline inline tables intact by @jdx in
[#14670](#14670)
- **(http)** retry the install rename on Windows when antivirus holds
the files by @jdx in [#14703](#14703)
- **(install)** extract 7z archives when the data dir contains `..` by
@jdx in [#14657](#14657)
- **(npm)** run allow_builds scripts despite ignore-scripts in .npmrc by
@jdx in [#14661](#14661)
- **(npm)** pin aube-lock.yaml so a user's lockfile settings don't break
mise lock by @jdx in [#14659](#14659)
- **(rust)** list channels when GitHub is unreachable behind a mirror by
@jdx in [#14662](#14662)
- **(shim)** keep the version tag in the Windows release mise-shim.exe
by @jdx in [#14656](#14656)
- **(task)** keep task commands working when one task's dir template is
broken by @jdx in [#14680](#14680)

### 🚜 Refactor

- **(schema)** generate the [deps] and [secrets] schema from their types
by @jdx in [#14658](#14658)
- **(schema)** generate the [daemons] and [daemon_providers] schema from
types by @jdx in [#14663](#14663)
- **(schema)** generate the [hooks] schema from declaration types by
@jdx in [#14666](#14666)
- **(schema)** generate the [bootstrap] raw-value schema from
declaration types by @jdx in
[#14668](#14668)
- **(schema)** generate the [tools] option schemas from declaration
types by @jdx in [#14669](#14669)
- **(schema)** generate the [env] and [vars] schema from declaration
types by @jdx in [#14671](#14671)
- **(schema)** generate the multi-shape task field schemas from
declaration types by @jdx in
[#14672](#14672)

### 📚 Documentation

- **(config)** add an interactive mise.toml editor and playground by
@jdx in [#14673](#14673)
- **(config)** hover over keys in every mise.toml example by @jdx in
[#14686](#14686)
- **(config)** turn the mise.toml reference into a key explorer by @jdx
in [#14687](#14687)
- **(config)** show a real example for every mise.toml reference key by
@jdx in [#14690](#14690)
- **(dotnet)** explain how private feeds authenticate by @jdx in
[#14679](#14679)
- **(schema)** describe the remaining bootstrap keys by @jdx in
[#14688](#14688)
- **(secrets)** add setup, CI and migration guidance to the fnox page by
@jdx in [#14675](#14675)
- record the landing-page showreel against current mise so its cache
fills by @jdx in [#14685](#14685)

### 📦️ Dependency Updates

- lock file maintenance by @renovate[bot] in
[#14708](#14708)

### 📦 Registry

- add release dates to dart, flutter, nim, julia and other http tools by
@jdx in [#14698](#14698)

### Ci

- **(release)** publish releases staged before install.ps1 existed by
@jdx in [#14684](#14684)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant