Skip to content

Commit d50287b

Browse files
authored
Add taplo.toml for toml formatting (#7618)
1 parent 82b6b3c commit d50287b

File tree

42 files changed

+186
-258
lines changed

Some content is hidden

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

42 files changed

+186
-258
lines changed

.typos.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# run: typos
44

55
[default.extend-words]
6-
ime = "ime" # Input Method Editor
6+
ime = "ime" # Input Method Editor
77
nknown = "nknown" # part of @55nknown username
8-
ro = "ro" # read-only, also part of the username @Phen-Ro
9-
typ = "typ" # Often used because `type` is a keyword in Rust
8+
ro = "ro" # read-only, also part of the username @Phen-Ro
9+
typ = "typ" # Often used because `type` is a keyword in Rust
1010

1111
# I mistype these so often
1212
tesalator = "tessellator"
@@ -146,5 +146,5 @@ extend-exclude = ["web_demo/egui_demo_app.js"] # auto-generated
146146

147147
[default]
148148
extend-ignore-re = [
149-
"#\\[doc\\(alias = .*", # We suggest "grey" in some doc
149+
"#\\[doc\\(alias = .*", # We suggest "grey" in some doc
150150
]

Cargo.toml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
[workspace]
22
resolver = "2"
33
members = [
4-
"crates/ecolor",
5-
"crates/egui_demo_app",
6-
"crates/egui_demo_lib",
7-
"crates/egui_extras",
8-
"crates/egui_glow",
9-
"crates/egui_kittest",
10-
"crates/egui-wgpu",
11-
"crates/egui-winit",
12-
"crates/egui",
13-
"crates/emath",
14-
"crates/epaint",
15-
"crates/epaint_default_fonts",
4+
"crates/ecolor",
5+
"crates/egui_demo_app",
6+
"crates/egui_demo_lib",
7+
"crates/egui_extras",
8+
"crates/egui_glow",
9+
"crates/egui_kittest",
10+
"crates/egui-wgpu",
11+
"crates/egui-winit",
12+
"crates/egui",
13+
"crates/emath",
14+
"crates/epaint",
15+
"crates/epaint_default_fonts",
1616

17-
"examples/*",
18-
"tests/*",
17+
"examples/*",
18+
"tests/*",
1919

20-
"xtask",
20+
"xtask",
2121
]
2222

2323
[workspace.package]
@@ -73,11 +73,11 @@ accesskit_consumer = "0.30.1"
7373
accesskit_winit = "0.29.1"
7474
ab_glyph = "0.2.32"
7575
ahash = { version = "0.8.12", default-features = false, features = [
76-
"no-rng", # we don't need DOS-protection, so we let users opt-in to it instead
77-
"std",
76+
"no-rng", # we don't need DOS-protection, so we let users opt-in to it instead
77+
"std",
7878
] }
7979
android_logger = "0.15.1"
80-
arboard = { version = "3.6.1", default-features = false}
80+
arboard = { version = "3.6.1", default-features = false }
8181
backtrace = "0.3.76"
8282
bitflags = "2.9.4"
8383
bytemuck = "1.24.0"
@@ -125,7 +125,7 @@ ron = "0.11.0"
125125
serde = { version = "1.0.228", features = ["derive"] }
126126
similar-asserts = "1.7.0"
127127
smallvec = "1.15.1"
128-
smithay-clipboard = "0.7.2"
128+
smithay-clipboard = "0.7.2"
129129
static_assertions = "1.1.0"
130130
syntect = { version = "5.3.0", default-features = false }
131131
tempfile = "3.23.0"
@@ -134,7 +134,7 @@ tokio = "1.47.1"
134134
type-map = "0.5.1"
135135
unicode_names2 = { version = "2.0.0", default-features = false }
136136
unicode-segmentation = "1.12.0"
137-
wasm-bindgen = "0.2.100" # Keep wasm-bindgen version in sync in: setup_web.sh, Cargo.toml, Cargo.lock, rust.yml
137+
wasm-bindgen = "0.2.100" # Keep wasm-bindgen version in sync in: setup_web.sh, Cargo.toml, Cargo.lock, rust.yml
138138
wasm-bindgen-futures = "0.4.0"
139139
wayland-cursor = { version = "0.31.11", default-features = false }
140140
web-sys = "0.3.77"
@@ -156,7 +156,7 @@ rust_2021_prelude_collisions = "warn"
156156
semicolon_in_expressions_from_macros = "warn"
157157
trivial_numeric_casts = "warn"
158158
unexpected_cfgs = "warn"
159-
unsafe_op_in_unsafe_fn = "warn" # `unsafe_op_in_unsafe_fn` may become the default in future Rust versions: https://github.com/rust-lang/rust/issues/71668
159+
unsafe_op_in_unsafe_fn = "warn" # `unsafe_op_in_unsafe_fn` may become the default in future Rust versions: https://github.com/rust-lang/rust/issues/71668
160160
unused_extern_crates = "warn"
161161
unused_import_braces = "warn"
162162
unused_lifetimes = "warn"
@@ -186,11 +186,11 @@ dbg_macro = "warn"
186186
debug_assert_with_mut_call = "warn"
187187
default_union_representation = "warn"
188188
derive_partial_eq_without_eq = "warn"
189-
disallowed_macros = "warn" # See clippy.toml
190-
disallowed_methods = "warn" # See clippy.toml
191-
disallowed_names = "warn" # See clippy.toml
192-
disallowed_script_idents = "warn" # See clippy.toml
193-
disallowed_types = "warn" # See clippy.toml
189+
disallowed_macros = "warn" # See clippy.toml
190+
disallowed_methods = "warn" # See clippy.toml
191+
disallowed_names = "warn" # See clippy.toml
192+
disallowed_script_idents = "warn" # See clippy.toml
193+
disallowed_types = "warn" # See clippy.toml
194194
doc_comment_double_space_linebreaks = "warn"
195195
doc_link_with_quotes = "warn"
196196
doc_markdown = "warn"
@@ -345,14 +345,14 @@ zero_sized_map_values = "warn"
345345
comparison_chain = "allow"
346346
should_panic_without_expect = "allow"
347347
too_many_lines = "allow"
348-
unwrap_used = "allow" # TODO(emilk): We really wanna warn on this one
348+
unwrap_used = "allow" # TODO(emilk): We really wanna warn on this one
349349

350350
# These are meh:
351-
assigning_clones = "allow" # No please
351+
assigning_clones = "allow" # No please
352352
let_underscore_must_use = "allow"
353353
let_underscore_untyped = "allow"
354-
manual_range_contains = "allow" # this one is just worse imho
355-
map_unwrap_or = "allow" # so is this one
356-
self_named_module_files = "allow" # Disabled waiting on https://github.com/rust-lang/rust-clippy/issues/9602
354+
manual_range_contains = "allow" # this one is just worse imho
355+
map_unwrap_or = "allow" # so is this one
356+
self_named_module_files = "allow" # Disabled waiting on https://github.com/rust-lang/rust-clippy/issues/9602
357357
significant_drop_tightening = "allow" # Too many false positives
358-
wildcard_imports = "allow" # `use crate::*` is useful to avoid merge conflicts when adding/removing imports
358+
wildcard_imports = "allow" # `use crate::*` is useful to avoid merge conflicts when adding/removing imports

clippy.toml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,50 @@ type-complexity-threshold = 350
2323

2424
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros
2525
disallowed-macros = [
26-
'std::dbg',
27-
'std::unimplemented',
28-
29-
# TODO(emilk): consider forbidding these to encourage the use of proper log stream, and then explicitly allow legitimate uses
30-
# 'std::eprint',
31-
# 'std::eprintln',
32-
# 'std::print',
33-
# 'std::println',
26+
'std::dbg',
27+
'std::unimplemented',
28+
29+
# TODO(emilk): consider forbidding these to encourage the use of proper log stream, and then explicitly allow legitimate uses
30+
# 'std::eprint',
31+
# 'std::eprintln',
32+
# 'std::print',
33+
# 'std::println',
3434
]
3535

3636
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
3737
disallowed-methods = [
38-
# NOTE: There are many things that aren't allowed on wasm,
39-
# but we cannot disable them all here (because of e.g. https://github.com/rust-lang/rust-clippy/issues/10406)
40-
# so we do that in `clipppy_wasm.toml` instead.
38+
# NOTE: There are many things that aren't allowed on wasm,
39+
# but we cannot disable them all here (because of e.g. https://github.com/rust-lang/rust-clippy/issues/10406)
40+
# so we do that in `clipppy_wasm.toml` instead.
4141

42-
{ path = "std::env::temp_dir", readon = "Use the tempfile crate instead" },
43-
{ path = "std::panic::catch_unwind", reason = "We compile with `panic = abort" },
44-
{ path = "std::thread::spawn", readon = "Use `std::thread::Builder` and name the thread" },
42+
{ path = "std::env::temp_dir", readon = "Use the tempfile crate instead" },
43+
{ path = "std::panic::catch_unwind", reason = "We compile with `panic = abort" },
44+
{ path = "std::thread::spawn", readon = "Use `std::thread::Builder` and name the thread" },
4545
]
4646

4747
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names
4848
disallowed-names = []
4949

5050
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types
5151
disallowed-types = [
52-
{ path = "std::sync::Condvar", reason = "Use parking_lot instead" },
53-
{ path = "std::sync::Mutex", reason = "Use epaint::mutex instead" },
54-
{ path = "std::sync::RwLock", reason = "Use epaint::mutex instead" },
55-
{ path = "winit::dpi::LogicalPosition", reason = "We do our own pixels<->point conversion, taking `egui_ctx.zoom_factor` into account" },
56-
{ path = "winit::dpi::LogicalSize", reason = "We do our own pixels<->point conversion, taking `egui_ctx.zoom_factor` into account" },
57-
# "std::sync::Once", # enabled for now as the `log_once` macro uses it internally
52+
{ path = "std::sync::Condvar", reason = "Use parking_lot instead" },
53+
{ path = "std::sync::Mutex", reason = "Use epaint::mutex instead" },
54+
{ path = "std::sync::RwLock", reason = "Use epaint::mutex instead" },
55+
{ path = "winit::dpi::LogicalPosition", reason = "We do our own pixels<->point conversion, taking `egui_ctx.zoom_factor` into account" },
56+
{ path = "winit::dpi::LogicalSize", reason = "We do our own pixels<->point conversion, taking `egui_ctx.zoom_factor` into account" },
57+
# "std::sync::Once", # enabled for now as the `log_once` macro uses it internally
5858
]
5959

6060
# -----------------------------------------------------------------------------
6161

6262
# Allow-list of words for markdown in docstrings https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
6363
doc-valid-idents = [
64-
# You must also update the same list in `scripts/clippy_wasm/clippy.toml`!
65-
"AccessKit",
66-
"WebGL",
67-
"WebGL1",
68-
"WebGL2",
69-
"WebGPU",
70-
"VirtualBox",
71-
"..",
64+
# You must also update the same list in `scripts/clippy_wasm/clippy.toml`!
65+
"AccessKit",
66+
"WebGL",
67+
"WebGL1",
68+
"WebGL2",
69+
"WebGPU",
70+
"VirtualBox",
71+
"..",
7272
]

crates/ecolor/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
[package]
22
name = "ecolor"
33
version.workspace = true
4-
authors = [
5-
"Emil Ernerfeldt <emil.ernerfeldt@gmail.com>",
6-
"Andreas Reich <reichandreas@gmx.de>",
7-
]
4+
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>", "Andreas Reich <reichandreas@gmx.de>"]
85
description = "Color structs and color conversion utilities"
96
edition.workspace = true
107
rust-version.workspace = true

crates/eframe/Cargo.toml

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ readme = "README.md"
1111
repository = "https://github.com/emilk/egui/tree/main/crates/eframe"
1212
categories = ["gui", "game-development"]
1313
keywords = ["egui", "gui", "gamedev"]
14-
include = [
15-
"../LICENSE-APACHE",
16-
"../LICENSE-MIT",
17-
"**/*.rs",
18-
"Cargo.toml",
19-
"data/icon.png",
20-
]
14+
include = ["../LICENSE-APACHE", "../LICENSE-MIT", "**/*.rs", "Cargo.toml", "data/icon.png"]
2115

2216
[package.metadata.docs.rs]
2317
all-features = true
@@ -35,7 +29,7 @@ default = [
3529
"accesskit",
3630
"default_fonts",
3731
"glow",
38-
"wayland", # Required for Linux support (including CI!)
32+
"wayland", # Required for Linux support (including CI!)
3933
"web_screen_reader",
4034
"winit/default",
4135
"x11",
@@ -66,13 +60,7 @@ default_fonts = ["egui/default_fonts"]
6660
glow = ["dep:egui_glow", "dep:glow", "dep:glutin-winit", "dep:glutin"]
6761

6862
## Enable saving app state to disk.
69-
persistence = [
70-
"dep:home",
71-
"egui-winit/serde",
72-
"egui/persistence",
73-
"ron",
74-
"serde",
75-
]
63+
persistence = ["dep:home", "egui-winit/serde", "egui/persistence", "ron", "serde"]
7664

7765
## Enables wayland support and fixes clipboard issue.
7866
##
@@ -88,10 +76,7 @@ wayland = [
8876
## Enable screen reader support (requires `ctx.options_mut(|o| o.screen_reader = true);`) on web.
8977
##
9078
## For other platforms, use the `accesskit` feature instead.
91-
web_screen_reader = [
92-
"web-sys/SpeechSynthesis",
93-
"web-sys/SpeechSynthesisUtterance",
94-
]
79+
web_screen_reader = ["web-sys/SpeechSynthesis", "web-sys/SpeechSynthesisUtterance"]
9580

9681
## Use [`wgpu`](https://docs.rs/wgpu) for painting (via [`egui-wgpu`](https://github.com/emilk/egui/tree/main/crates/egui-wgpu)).
9782
##
@@ -145,10 +130,7 @@ serde = { workspace = true, optional = true }
145130
# -------------------------------------------
146131
# native:
147132
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
148-
egui-winit = { workspace = true, default-features = false, features = [
149-
"clipboard",
150-
"links",
151-
] }
133+
egui-winit = { workspace = true, default-features = false, features = ["clipboard", "links"] }
152134
image = { workspace = true, features = ["png"] } # Needed for app icon
153135
winit = { workspace = true, default-features = false, features = ["rwh_06"] }
154136

@@ -158,10 +140,7 @@ egui-wgpu = { workspace = true, optional = true, features = [
158140
] } # if wgpu is used, use it with winit
159141
pollster = { workspace = true, optional = true } # needed for wgpu
160142

161-
glutin = { workspace = true, optional = true, default-features = false, features = [
162-
"egl",
163-
"wgl",
164-
] }
143+
glutin = { workspace = true, optional = true, default-features = false, features = ["egl", "wgl"] }
165144
glutin-winit = { workspace = true, optional = true, default-features = false, features = [
166145
"egl",
167146
"wgl",

crates/egui-wgpu/Cargo.toml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@ readme = "README.md"
1515
repository = "https://github.com/emilk/egui/tree/main/crates/egui-wgpu"
1616
categories = ["gui", "game-development"]
1717
keywords = ["wgpu", "egui", "gui", "gamedev"]
18-
include = [
19-
"../LICENSE-APACHE",
20-
"../LICENSE-MIT",
21-
"**/*.rs",
22-
"**/*.wgsl",
23-
"Cargo.toml",
24-
]
18+
include = ["../LICENSE-APACHE", "../LICENSE-MIT", "**/*.rs", "**/*.wgsl", "Cargo.toml"]
2519

2620
[lints]
2721
workspace = true

crates/egui-winit/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,4 @@ smithay-clipboard = { workspace = true, optional = true }
100100
wayland-cursor = { workspace = true, optional = true }
101101

102102
[target.'cfg(not(target_os = "android"))'.dependencies]
103-
arboard = { workspace = true, optional = true, features = [
104-
"image-data",
105-
] }
103+
arboard = { workspace = true, optional = true, features = ["image-data"] }

crates/egui_demo_app/Cargo.toml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@ web_app = ["http", "persistence"]
3131
accessibility_inspector = ["dep:accesskit", "dep:accesskit_consumer", "eframe/accesskit"]
3232
http = ["ehttp", "image/jpeg", "poll-promise", "egui_extras/image"]
3333
image_viewer = ["image/jpeg", "egui_extras/all_loaders", "rfd"]
34-
persistence = [
35-
"eframe/persistence",
36-
"egui_extras/serde",
37-
"egui/persistence",
38-
"serde",
39-
]
34+
persistence = ["eframe/persistence", "egui_extras/serde", "egui/persistence", "serde"]
4035
puffin = ["dep:puffin", "dep:puffin_http", "profiling/profile-with-puffin"]
4136
serde = ["dep:serde", "egui_demo_lib/serde", "egui/serde"]
4237
syntect = ["egui_demo_lib/syntect"]
@@ -48,9 +43,7 @@ x11 = ["eframe/x11"]
4843

4944
[dependencies]
5045
chrono = { workspace = true, features = ["js-sys", "wasmbind"] }
51-
eframe = { workspace = true, default-features = false, features = [
52-
"web_screen_reader",
53-
] }
46+
eframe = { workspace = true, default-features = false, features = ["web_screen_reader"] }
5447
egui = { workspace = true, features = ["callstack", "default"] }
5548
egui_demo_lib = { workspace = true, features = ["default", "chrono"] }
5649
egui_extras = { workspace = true, features = ["default", "image"] }
@@ -69,11 +62,7 @@ puffin = { workspace = true, optional = true }
6962
puffin_http = { workspace = true, optional = true }
7063
# Enable both WebGL & WebGPU when targeting the web (these features have no effect when not targeting wasm32)
7164
# Also enable the default features so we have a supported backend for every platform.
72-
wgpu = { workspace = true, features = [
73-
"default",
74-
"webgpu",
75-
"webgl",
76-
], optional = true }
65+
wgpu = { workspace = true, features = ["default", "webgpu", "webgl"], optional = true }
7766

7867

7968
# feature "http":

crates/egui_demo_lib/Cargo.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ readme = "README.md"
1111
repository = "https://github.com/emilk/egui/tree/main/crates/egui_demo_lib"
1212
categories = ["gui", "graphics"]
1313
keywords = ["glow", "egui", "gui", "gamedev"]
14-
include = [
15-
"../LICENSE-APACHE",
16-
"../LICENSE-MIT",
17-
"**/*.rs",
18-
"Cargo.toml",
19-
"data/*",
20-
]
14+
include = ["../LICENSE-APACHE", "../LICENSE-MIT", "**/*.rs", "Cargo.toml", "data/*"]
2115

2216
[lints]
2317
workspace = true
@@ -60,7 +54,7 @@ egui = { workspace = true, features = ["default_fonts"] }
6054
egui_extras = { workspace = true, features = ["image", "svg"] }
6155
egui_kittest = { workspace = true, features = ["wgpu", "snapshot"] }
6256
image = { workspace = true, features = ["png"] }
63-
mimalloc.workspace = true # for benchmarks
57+
mimalloc.workspace = true # for benchmarks
6458
rand.workspace = true
6559

6660
[[bench]]

0 commit comments

Comments
 (0)