-
-
Notifications
You must be signed in to change notification settings - Fork 159
Open
Description
The dependencies table will not be sorted by Taplo in the following Cargo.toml file, leaving c and b out of order:
[package]
name = "foo"
[dependencies]
a = { workspace = true }
c = { workspace = true }
b = { workspace = true }
[package.metadata.cargo-machete]
ignored = ["serde"]But if we simply move the subtable package.metadata.cargo-machete before dependencies as in:
[package]
name = "foo"
[package.metadata.cargo-machete]
ignored = ["serde"]
[dependencies]
a = { workspace = true }
c = { workspace = true }
b = { workspace = true }Then taplo format Cargo.toml will reorder c and b as required.
Our .taplo.toml configuration:
# General
[formatting]
reorder_arrays = true
reorder_keys = true
# Cargo.toml
[[rule]]
include = ["**/Cargo.toml"]
keys = [
"bench",
"package",
"workspace.lints.clippy",
"workspace.lints.rust",
"workspace.package",
]
[rule.formatting]
reorder_keys = false
# pyproject.toml
[[rule]]
include = ["**/pyproject.toml"]
keys = ["project", "tool.poetry"]
[rule.formatting]
reorder_keys = false
# wrangler.toml
[[rule]]
include = ["**/wrangler.toml"]
[rule.formatting]
reorder_keys = falseTaplo version:
❯ taplo --version
taplo 0.10.0Metadata
Metadata
Assignees
Labels
No labels