Skip to content

Commit 9848cb2

Browse files
authored
Format TOML files using Taplo (#2057)
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.
1 parent 5d4420f commit 9848cb2

File tree

51 files changed

+734
-684
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+734
-684
lines changed

.config/nextest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ test(=header_check_memory_concurrent) |
2121
test(=header_link_concurrent) |
2222
test(=header_link_failure_concurrent)
2323
"""
24-
threads-required = 'num-cpus'
2524
slow-timeout = { period = "60s", terminate-after = 6 }
25+
threads-required = 'num-cpus'

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ jobs:
106106

107107
- name: Install latest cargo-semver-checks
108108
uses: taiki-e/install-action@cargo-semver-checks
109+
110+
- name: Install latest taplo
111+
uses: taiki-e/install-action@taplo
109112

110113
- name: Code format check
111114
run: rustfmt --check --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate,skip_children=true" $(git ls-files '*.rs')
@@ -161,6 +164,10 @@ jobs:
161164

162165
- name: Check SemVer Compatibility
163166
run: cargo +stable semver-checks --verbose --default-features --package zenoh --release-type ${{ env.CARGO_SEMVER_CHECKS_RELEASE_TYPE }} --baseline-version ${{ env.CARGO_SEMVER_CHECKS_BASELINE_VERSION }}
167+
168+
- name: Check TOML formatting
169+
if: ${{ !contains(matrix.os, 'windows') }}
170+
run: taplo fmt --check --diff
164171

165172
test:
166173
needs: determine-runner

.pre-commit-config.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
repos:
1515
- repo: local
1616
hooks:
17-
- id: fmt
18-
name: fmt
17+
- id: fmt-rust
18+
name: fmt-rust
1919
entry: bash -c 'rustfmt --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate,skip_children=true" $(git ls-files '*.rs')'
2020
language: system
2121
types: [rust]
22+
- repo: https://github.com/ComPWA/taplo-pre-commit
23+
rev: v0.9.3
24+
hooks:
25+
- id: taplo-format

.taplo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
exclude = ["target/**"]
2+
3+
[[rule]]
4+
5+
[rule.formatting]
6+
reorder_arrays = true
7+
reorder_keys = true

Cargo.toml

Lines changed: 107 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -12,66 +12,66 @@
1212
# ZettaScale Zenoh Team, <zenoh@zettascale.tech>
1313
#
1414
[workspace]
15-
resolver = "2"
15+
exclude = ["ci/nostd-check", "ci/valgrind-check"]
1616
members = [
17-
"commons/zenoh-buffers",
18-
"commons/zenoh-codec",
19-
"commons/zenoh-collections",
20-
"commons/zenoh-config",
21-
"commons/zenoh-core",
22-
"commons/zenoh-crypto",
23-
"commons/zenoh-keyexpr",
24-
"commons/zenoh-macros",
25-
"commons/zenoh-protocol",
26-
"commons/zenoh-result",
27-
"commons/zenoh-shm",
28-
"commons/zenoh-sync",
29-
"commons/zenoh-task",
30-
"commons/zenoh-util",
31-
"commons/zenoh-runtime",
32-
"examples",
33-
"io/zenoh-link",
34-
"io/zenoh-link-commons",
35-
"io/zenoh-links/zenoh-link-quic/",
36-
"io/zenoh-links/zenoh-link-quic_datagram/",
37-
"io/zenoh-links/zenoh-link-serial",
38-
"io/zenoh-links/zenoh-link-tcp/",
39-
"io/zenoh-links/zenoh-link-tls/",
40-
"io/zenoh-links/zenoh-link-udp/",
41-
"io/zenoh-links/zenoh-link-unixsock_stream/",
42-
"io/zenoh-links/zenoh-link-ws/",
43-
"io/zenoh-links/zenoh-link-unixpipe/",
44-
"io/zenoh-links/zenoh-link-vsock/",
45-
"io/zenoh-transport",
46-
"plugins/zenoh-backend-example",
47-
"plugins/zenoh-plugin-example",
48-
"plugins/zenoh-backend-traits",
49-
"plugins/zenoh-plugin-rest",
50-
"plugins/zenoh-plugin-storage-manager",
51-
"plugins/zenoh-plugin-trait",
52-
"zenoh",
53-
"zenoh-ext",
54-
"zenoh-ext/examples",
55-
"zenohd",
17+
"commons/zenoh-buffers",
18+
"commons/zenoh-codec",
19+
"commons/zenoh-collections",
20+
"commons/zenoh-config",
21+
"commons/zenoh-core",
22+
"commons/zenoh-crypto",
23+
"commons/zenoh-keyexpr",
24+
"commons/zenoh-macros",
25+
"commons/zenoh-protocol",
26+
"commons/zenoh-result",
27+
"commons/zenoh-runtime",
28+
"commons/zenoh-shm",
29+
"commons/zenoh-sync",
30+
"commons/zenoh-task",
31+
"commons/zenoh-util",
32+
"examples",
33+
"io/zenoh-link",
34+
"io/zenoh-link-commons",
35+
"io/zenoh-links/zenoh-link-quic/",
36+
"io/zenoh-links/zenoh-link-quic_datagram/",
37+
"io/zenoh-links/zenoh-link-serial",
38+
"io/zenoh-links/zenoh-link-tcp/",
39+
"io/zenoh-links/zenoh-link-tls/",
40+
"io/zenoh-links/zenoh-link-udp/",
41+
"io/zenoh-links/zenoh-link-unixpipe/",
42+
"io/zenoh-links/zenoh-link-unixsock_stream/",
43+
"io/zenoh-links/zenoh-link-vsock/",
44+
"io/zenoh-links/zenoh-link-ws/",
45+
"io/zenoh-transport",
46+
"plugins/zenoh-backend-example",
47+
"plugins/zenoh-backend-traits",
48+
"plugins/zenoh-plugin-example",
49+
"plugins/zenoh-plugin-rest",
50+
"plugins/zenoh-plugin-storage-manager",
51+
"plugins/zenoh-plugin-trait",
52+
"zenoh",
53+
"zenoh-ext",
54+
"zenoh-ext/examples",
55+
"zenohd",
5656
]
57-
exclude = ["ci/nostd-check", "ci/valgrind-check"]
57+
resolver = "2"
5858

5959
[workspace.package]
60-
rust-version = "1.75.0"
61-
version = "1.5.0"
62-
repository = "https://github.com/eclipse-zenoh/zenoh"
63-
homepage = "http://zenoh.io"
6460
authors = [
65-
"kydos <angelo@icorsaro.net>",
66-
"Julien Enoch <julien@enoch.fr>",
67-
"Olivier Hécart <olivier.hecart@zettascale.tech>",
68-
"Luca Cominardi <luca.cominardi@zettascale.tech>",
69-
"Pierre Avital <pierre.avital@zettascale.tech>",
61+
"Julien Enoch <julien@enoch.fr>",
62+
"Luca Cominardi <luca.cominardi@zettascale.tech>",
63+
"Olivier Hécart <olivier.hecart@zettascale.tech>",
64+
"Pierre Avital <pierre.avital@zettascale.tech>",
65+
"kydos <angelo@icorsaro.net>",
7066
]
71-
edition = "2021"
72-
license = "EPL-2.0 OR Apache-2.0"
7367
categories = ["network-programming"]
7468
description = "Zenoh: The Zero Overhead Pub/Sub/Query Protocol."
69+
edition = "2021"
70+
homepage = "http://zenoh.io"
71+
license = "EPL-2.0 OR Apache-2.0"
72+
repository = "https://github.com/eclipse-zenoh/zenoh"
73+
rust-version = "1.75.0"
74+
version = "1.5.0"
7575

7676
# DEFAULT-FEATURES NOTE: Be careful with default-features and additivity!
7777
# (https://github.com/rust-lang/cargo/issues/11329)
@@ -93,20 +93,18 @@ clap = { version = "4.5.17", features = ["derive"] }
9393
console-subscriber = "0.4.0"
9494
const_format = "0.2.33"
9595
criterion = "0.5"
96-
crossbeam-utils = "0.8.20"
97-
crossbeam-queue = "0.3.12"
9896
crossbeam-channel = "0.5"
99-
static_assertions = "1.1.0"
100-
derive_more = { version = "1.0.0", features = ["as_ref"] }
97+
crossbeam-queue = "0.3.12"
98+
crossbeam-utils = "0.8.20"
10199
derive-new = "0.7.0"
102-
tracing-subscriber = { version = "0.3", features = ["json", "env-filter"] }
100+
derive_more = { version = "1.0.0", features = ["as_ref"] }
103101
event-listener = "5.3.1"
104102
flume = "0.11"
105103
form_urlencoded = "1.2.1"
106104
futures = "0.3.31"
107105
futures-util = { version = "0.3.31", default-features = false } # Default features are disabled due to some crates' requirements
108-
git-version = "0.3.9"
109106
getrandom = { version = "0.2" }
107+
git-version = "0.3.9"
110108
hashbrown = "0.14"
111109
hex = { version = "0.4.3", default-features = false } # Default features are disabled due to usage in no_std crates
112110
hmac = { version = "0.12.1", features = ["std"] }
@@ -121,12 +119,11 @@ lazy_static = "1.5.0"
121119
leb128 = "0.2"
122120
libc = "0.2.158"
123121
libloading = "0.8"
124-
tracing = "0.1"
125122
lz4_flex = "0.11"
126123
nix = { version = "0.29.0", features = ["fs"] }
127124
nonempty-collections = { version = "0.3.0", features = ["serde"] }
128-
num_cpus = "1.16.0"
129125
num-traits = { version = "0.2.19", default-features = false }
126+
num_cpus = "1.16.0"
130127
once_cell = "1.19.0"
131128
ordered-float = "4.2.2"
132129
panic-message = "0.3.0"
@@ -143,116 +140,119 @@ rand_chacha = "0.3.1"
143140
rcgen = "0.13.1"
144141
ref-cast = "1.0.23"
145142
regex = "1.10.6"
146-
ron = "0.8.1"
147143
ringbuffer-spsc = "0.1.9"
144+
ron = "0.8.1"
148145
rsa = "0.9"
149146
rustc_version = "0.4.1"
150147
rustls = { version = "0.23.13", default-features = false, features = [
151-
"logging",
152-
"tls12",
153-
"ring",
148+
"logging",
149+
"ring",
150+
"tls12",
154151
] }
155152
rustls-native-certs = "0.8.0"
156153
rustls-pemfile = "2.1.3"
157-
rustls-webpki = "0.102.8"
158154
rustls-pki-types = "1.8.0"
155+
rustls-webpki = "0.102.8"
159156
schemars = { version = "0.8.21", features = ["either"] }
160-
secrecy = { version = "0.8.0", features = ["serde", "alloc"] }
157+
secrecy = { version = "0.8.0", features = ["alloc", "serde"] }
161158
serde = { version = "1.0.210", default-features = false, features = [
162-
"derive",
159+
"derive",
163160
] } # Default features are disabled due to usage in no_std crates
164161
serde_json = "1.0.128"
165162
serde_with = "3.12.0"
166163
serde_yaml = "0.9.34"
167-
static_init = "1.0.3"
168-
stabby = "36.1.1"
169164
sha3 = "0.10.8"
170165
shellexpand = "3.1.0"
171166
socket2 = { version = "0.5.7", features = ["all"] }
167+
stabby = "36.1.1"
168+
static_assertions = "1.1.0"
169+
static_init = "1.0.3"
172170
stop-token = "0.7.0"
173171
syn = "2.0"
174172
test-case = "3.3.1"
175173
tide = "0.16.0"
176174
time = "0.3.36"
177175
token-cell = { version = "1.5.0", default-features = false }
178176
tokio = { version = "1.40.0", default-features = false } # Default features are disabled due to some crates' requirements
179-
tokio-util = "0.7.12"
180-
tokio-tungstenite = "0.24.0"
181177
tokio-rustls = { version = "0.26.0", default-features = false }
178+
tokio-tungstenite = "0.24.0"
179+
tokio-util = "0.7.12"
180+
tracing = "0.1"
181+
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
182182
# tokio-vsock = see: io/zenoh-links/zenoh-link-vsock/Cargo.toml (workspaces does not support platform dependent dependencies)
183+
either = "1.13.0"
184+
prost = "0.13.2"
183185
thread-priority = "1.1.0"
186+
tls-listener = { version = "0.11.0", features = ["rustls-ring"] }
184187
typenum = "1.17.0"
185188
uhlc = { version = "0.8.0", default-features = false } # Default features are disabled due to usage in no_std crates
186189
unzip-n = "0.1.2"
187190
url = "2.5.2"
188191
urlencoding = "2.1.3"
189192
uuid = { version = "1.10.0", default-features = false, features = [
190-
"v4",
193+
"v4",
191194
] } # Default features are disabled due to usage in no_std crates
192195
validated_struct = "2.1.0"
193196
vec_map = "0.8.2"
194197
webpki-roots = "0.26.5"
195198
win-sys = "0.3"
196199
winapi = { version = "0.3.9", features = ["iphlpapi", "winerror"] }
197-
x509-parser = "0.16.0"
198-
z-serial = "0.3.1"
199-
either = "1.13.0"
200-
prost = "0.13.2"
201-
tls-listener = { version = "0.11.0", features = ["rustls-ring"] }
202200
windows-sys = { version = "0.59.0", features = [
203-
"Win32_Foundation",
204-
"Win32_Networking_WinSock",
205-
"Win32_System_IO",
201+
"Win32_Foundation",
202+
"Win32_Networking_WinSock",
203+
"Win32_System_IO",
206204
] }
207-
zenoh-ext = { version = "=1.5.0", path = "zenoh-ext", default-features = false }
208-
zenoh-shm = { version = "=1.5.0", path = "commons/zenoh-shm" }
209-
zenoh-result = { version = "=1.5.0", path = "commons/zenoh-result", default-features = false }
210-
zenoh-config = { version = "=1.5.0", path = "commons/zenoh-config" }
211-
zenoh-protocol = { version = "=1.5.0", path = "commons/zenoh-protocol", default-features = false }
212-
zenoh-keyexpr = { version = "=1.5.0", path = "commons/zenoh-keyexpr", default-features = false }
213-
zenoh-core = { version = "=1.5.0", path = "commons/zenoh-core" }
205+
x509-parser = "0.16.0"
206+
z-serial = "0.3.1"
207+
zenoh = { version = "=1.5.0", path = "zenoh", default-features = false }
214208
zenoh-buffers = { version = "=1.5.0", path = "commons/zenoh-buffers", default-features = false }
215-
zenoh-util = { version = "=1.5.0", path = "commons/zenoh-util" }
216-
zenoh-crypto = { version = "=1.5.0", path = "commons/zenoh-crypto" }
217209
zenoh-codec = { version = "=1.5.0", path = "commons/zenoh-codec" }
218-
zenoh-sync = { version = "=1.5.0", path = "commons/zenoh-sync" }
219210
zenoh-collections = { version = "=1.5.0", path = "commons/zenoh-collections", default-features = false }
220-
zenoh-macros = { version = "=1.5.0", path = "commons/zenoh-macros" }
221-
zenoh-plugin-trait = { version = "=1.5.0", path = "plugins/zenoh-plugin-trait", default-features = false }
222-
zenoh_backend_traits = { version = "=1.5.0", path = "plugins/zenoh-backend-traits", default-features = false }
223-
zenoh-transport = { version = "=1.5.0", path = "io/zenoh-transport", default-features = false }
224-
zenoh-link-tls = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-tls" }
225-
zenoh-link-tcp = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-tcp" }
226-
zenoh-link-unixsock_stream = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-unixsock_stream" }
211+
zenoh-config = { version = "=1.5.0", path = "commons/zenoh-config" }
212+
zenoh-core = { version = "=1.5.0", path = "commons/zenoh-core" }
213+
zenoh-crypto = { version = "=1.5.0", path = "commons/zenoh-crypto" }
214+
zenoh-examples = { version = "=1.5.0", path = "examples", default-features = false }
215+
zenoh-ext = { version = "=1.5.0", path = "zenoh-ext", default-features = false }
216+
zenoh-keyexpr = { version = "=1.5.0", path = "commons/zenoh-keyexpr", default-features = false }
217+
zenoh-link = { version = "=1.5.0", path = "io/zenoh-link" }
218+
zenoh-link-commons = { version = "=1.5.0", path = "io/zenoh-link-commons" }
227219
zenoh-link-quic = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-quic" }
228220
zenoh-link-quic_datagram = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-quic_datagram" }
221+
zenoh-link-serial = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-serial" }
222+
zenoh-link-tcp = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-tcp" }
223+
zenoh-link-tls = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-tls" }
229224
zenoh-link-udp = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-udp" }
230-
zenoh-link-ws = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-ws" }
231225
zenoh-link-unixpipe = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-unixpipe" }
232-
zenoh-link-serial = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-serial" }
226+
zenoh-link-unixsock_stream = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-unixsock_stream" }
233227
zenoh-link-vsock = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-vsock" }
234-
zenoh-link = { version = "=1.5.0", path = "io/zenoh-link" }
235-
zenoh-link-commons = { version = "=1.5.0", path = "io/zenoh-link-commons" }
236-
zenoh = { version = "=1.5.0", path = "zenoh", default-features = false }
228+
zenoh-link-ws = { version = "=1.5.0", path = "io/zenoh-links/zenoh-link-ws" }
229+
zenoh-macros = { version = "=1.5.0", path = "commons/zenoh-macros" }
230+
zenoh-plugin-trait = { version = "=1.5.0", path = "plugins/zenoh-plugin-trait", default-features = false }
231+
zenoh-protocol = { version = "=1.5.0", path = "commons/zenoh-protocol", default-features = false }
232+
zenoh-result = { version = "=1.5.0", path = "commons/zenoh-result", default-features = false }
237233
zenoh-runtime = { version = "=1.5.0", path = "commons/zenoh-runtime" }
234+
zenoh-shm = { version = "=1.5.0", path = "commons/zenoh-shm" }
235+
zenoh-sync = { version = "=1.5.0", path = "commons/zenoh-sync" }
238236
zenoh-task = { version = "=1.5.0", path = "commons/zenoh-task" }
239-
zenoh-examples = { version = "=1.5.0", path = "examples", default-features = false }
237+
zenoh-transport = { version = "=1.5.0", path = "io/zenoh-transport", default-features = false }
238+
zenoh-util = { version = "=1.5.0", path = "commons/zenoh-util" }
239+
zenoh_backend_traits = { version = "=1.5.0", path = "plugins/zenoh-backend-traits", default-features = false }
240240

241241
[profile.dev]
242242
debug = true
243243
opt-level = 0
244244

245245
[profile.fast]
246-
inherits = "release"
247-
opt-level = 3
248246
debug = true
249247
debug-assertions = true
250-
overflow-checks = true
248+
inherits = "release"
251249
lto = false
250+
opt-level = 3
251+
overflow-checks = true
252252

253253
[profile.release]
254+
codegen-units = 1
254255
debug = false # If you want debug symbol in release mode, set the env variable: RUSTFLAGS=-g
255256
lto = "fat"
256-
codegen-units = 1
257257
opt-level = 3
258258
panic = "abort"

Cross.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ image = "jenoch/rust-cross:aarch64-unknown-linux-gnu"
1515

1616
[target.aarch64-unknown-linux-musl]
1717
image = "jenoch/rust-cross:aarch64-unknown-linux-musl"
18-

_typos.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
extend-exclude = [
33
# Ignore files containing hexa.
44
"io/zenoh-transport/tests/*.rs",
5-
"zenoh/tests/open_time.rs",
65
"zenoh/tests/authentication.rs",
6+
"zenoh/tests/open_time.rs",
77
]
88

99

0 commit comments

Comments
 (0)