Rewild Your Web
web browser dweb

chore: create a formatting script

+32 -8
+13
format.sh
···
··· 1 + #!/bin/bash 2 + 3 + # Format our code in a similar way as source/python/servo/testing_commands.py 4 + 5 + # Format Rust code 6 + cargo fmt -- \ 7 + --config unstable_features=true \ 8 + --config binop_separator=Back \ 9 + --config imports_granularity=Module \ 10 + --config group_imports=StdExternalCrate 11 + 12 + # Format our Cargo.toml files 13 + RUST_LOG=error taplo fmt Cargo.toml htmlshell/Cargo.toml
+7 -8
htmlshell/src/vhost.rs
··· 50 51 // Currently recognized: system, shared, keyboard, homescreen, theme 52 // TODO: don't hardcode 53 - if app != "homescreen" 54 - && app != "keyboard" 55 - && app != "settings" 56 - && app != "shared" 57 - && app != "system" 58 - && app != "theme" 59 { 60 return None; 61 } ··· 142 .allow_methods(Any) 143 .allow_headers(Any); 144 145 - let compression = CompressionLayer::new() 146 - .zstd(true); 147 148 let app = Router::new() 149 .route("/{*key}", get(get_file))
··· 50 51 // Currently recognized: system, shared, keyboard, homescreen, theme 52 // TODO: don't hardcode 53 + if app != "homescreen" && 54 + app != "keyboard" && 55 + app != "settings" && 56 + app != "shared" && 57 + app != "system" && 58 + app != "theme" 59 { 60 return None; 61 } ··· 142 .allow_methods(Any) 143 .allow_headers(Any); 144 145 + let compression = CompressionLayer::new().zstd(true); 146 147 let app = Router::new() 148 .route("/{*key}", get(get_file))
+3
rustfmt.toml
···
··· 1 + match_block_trailing_comma = true 2 + reorder_imports = true 3 + style_edition = "2024"
+9
taplo.toml
···
··· 1 + # upstream files we should not format 2 + exclude = ["third_party/**", "tests/**"] 3 + 4 + [formatting] 5 + array_auto_collapse = false 6 + array_auto_expand = false 7 + align_comments = false 8 + column_width = 120 9 + indent_string = " "