Skip to content

Format TOML files using Taplo#2057

Merged
fuzzypixelz merged 1 commit intomainfrom
toml-fmt
Jul 30, 2025
Merged

Format TOML files using Taplo#2057
fuzzypixelz merged 1 commit intomainfrom
toml-fmt

Conversation

@fuzzypixelz
Copy link
Member

Taplo is a TOML toolkit. It is the default LSP implementation used in Zed and the popular "Even Better TOML" VS Code extension.

This commit leverages Taplo to ensure uniform TOML formatting in CI and locally (through precommit hooks), thus removing patch pollution due to TOML formatting changes.

This is a temporary solution until the question of TOML formatting is resolved upstream: rust-lang/rustfmt#4091.

@fuzzypixelz fuzzypixelz added the internal Changes not included in the changelog label Jul 22, 2025
@codecov
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.07%. Comparing base (5d4420f) to head (7a96852).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2057      +/-   ##
==========================================
+ Coverage   71.00%   71.07%   +0.06%     
==========================================
  Files         370      370              
  Lines       62857    62781      -76     
==========================================
- Hits        44634    44621      -13     
+ Misses      18223    18160      -63     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@wyfo wyfo left a comment

Choose a reason for hiding this comment

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

Could you add alphabetical sorting? I remember having tried taplo for zenoh a while ago, and having trouble with sorting, but I'm don't remember exactly what the problem was (maybe dependency feature sorting).
Also, we should do the same in all other zenoh repository.

@fuzzypixelz
Copy link
Member Author

Could you add alphabetical sorting? I remember having tried taplo for zenoh a while ago, and having trouble with sorting, but I'm don't remember exactly what the problem was (maybe dependency feature sorting).

Done. I chose not to set reorder_inline_tables (makes "version" go after "features").

Also, we should do the same in all other zenoh repository.

Eventually! But let's not move the goalpost and instead see how this goes before we generalize to all repos.

I'm also making this into a draft so it wouldn't interfere with the coming release (cc @diogomatsubara).

@fuzzypixelz fuzzypixelz marked this pull request as draft July 24, 2025 08:46
@diogomatsubara
Copy link
Contributor

Could you add alphabetical sorting? I remember having tried taplo for zenoh a while ago, and having trouble with sorting, but I'm don't remember exactly what the problem was (maybe dependency feature sorting).

Done. I chose not to set reorder_inline_tables (makes "version" go after "features").

Also, we should do the same in all other zenoh repository.

Eventually! But let's not move the goalpost and instead see how this goes before we generalize to all repos.

I'm also making this into a draft so it wouldn't interfere with the coming release (cc @diogomatsubara).

@fuzzypixelz release is done, so feel free to merge whenever it's ready.

@wyfo
Copy link
Contributor

wyfo commented Jul 29, 2025

Use a pre-commit hook like https://github.com/ComPWA/taplo-pre-commit to have automatic installation.

@fuzzypixelz fuzzypixelz force-pushed the toml-fmt branch 2 times, most recently from b394bf6 to e19fe06 Compare July 30, 2025 09:41
@fuzzypixelz fuzzypixelz marked this pull request as ready for review July 30, 2025 09:41
@fuzzypixelz fuzzypixelz enabled auto-merge (squash) July 30, 2025 09:41
@fuzzypixelz fuzzypixelz disabled auto-merge July 30, 2025 09:41
@fuzzypixelz fuzzypixelz enabled auto-merge (squash) July 30, 2025 09:42
Taplo is a TOML toolkit. It is the default LSP implementation used in
Zed and the popular "Even Better TOML" VS Code extension.

This commit leverages Taplo to ensure uniform TOML formatting in CI and
locally (through precommit hooks), thus removing patch pollution due to
TOML formatting changes.

Note Arrays and keys are ordered alphabetically, but not inline table
keys (otherwise `features` would go before `version` in Cargo Manifest
files.

This is a temporary solution until the question of TOML formatting is
resolved upstream.
@fuzzypixelz fuzzypixelz merged commit 9848cb2 into main Jul 30, 2025
46 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Changes not included in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants