tangled
alpha
login
or
join now
me.webbeef.org
/
browser.html
Rewild Your Web
web
browser
dweb
4
fork
atom
overview
issues
pulls
pipelines
chore: create a formatting script
webbeef.tngl.sh
1 week ago
80a2cb02
28d213c6
+32
-8
4 changed files
expand all
collapse all
unified
split
format.sh
htmlshell
src
vhost.rs
rustfmt.toml
taplo.toml
+13
format.sh
···
1
1
+
#!/bin/bash
2
2
+
3
3
+
# Format our code in a similar way as source/python/servo/testing_commands.py
4
4
+
5
5
+
# Format Rust code
6
6
+
cargo fmt -- \
7
7
+
--config unstable_features=true \
8
8
+
--config binop_separator=Back \
9
9
+
--config imports_granularity=Module \
10
10
+
--config group_imports=StdExternalCrate
11
11
+
12
12
+
# Format our Cargo.toml files
13
13
+
RUST_LOG=error taplo fmt Cargo.toml htmlshell/Cargo.toml
+7
-8
htmlshell/src/vhost.rs
···
50
50
51
51
// Currently recognized: system, shared, keyboard, homescreen, theme
52
52
// TODO: don't hardcode
53
53
-
if app != "homescreen"
54
54
-
&& app != "keyboard"
55
55
-
&& app != "settings"
56
56
-
&& app != "shared"
57
57
-
&& app != "system"
58
58
-
&& app != "theme"
53
53
+
if app != "homescreen" &&
54
54
+
app != "keyboard" &&
55
55
+
app != "settings" &&
56
56
+
app != "shared" &&
57
57
+
app != "system" &&
58
58
+
app != "theme"
59
59
{
60
60
return None;
61
61
}
···
142
142
.allow_methods(Any)
143
143
.allow_headers(Any);
144
144
145
145
-
let compression = CompressionLayer::new()
146
146
-
.zstd(true);
145
145
+
let compression = CompressionLayer::new().zstd(true);
147
146
148
147
let app = Router::new()
149
148
.route("/{*key}", get(get_file))
+3
rustfmt.toml
···
1
1
+
match_block_trailing_comma = true
2
2
+
reorder_imports = true
3
3
+
style_edition = "2024"
+9
taplo.toml
···
1
1
+
# upstream files we should not format
2
2
+
exclude = ["third_party/**", "tests/**"]
3
3
+
4
4
+
[formatting]
5
5
+
array_auto_collapse = false
6
6
+
array_auto_expand = false
7
7
+
align_comments = false
8
8
+
column_width = 120
9
9
+
indent_string = " "