diff --git a/.leptosfmt.toml b/.leptosfmt.toml new file mode 100644 index 0000000..ac5be1f --- /dev/null +++ b/.leptosfmt.toml @@ -0,0 +1,2 @@ +max_width = 100 +attr_value_brace_style = "WhenRequired" # "Always", "AlwaysUnlessLit", "WhenRequired" or "Preserve" diff --git a/.woodpecker.yml b/.woodpecker.yml index 8f6a6ce..94b4541 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,5 +1,6 @@ variables: - &rust_image "rust:1.75" + - &install_binstall "wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz && tar -xvf cargo-binstall-x86_64-unknown-linux-musl.tgz && cp cargo-binstall /usr/local/cargo/bin" steps: cargo_fmt: @@ -10,6 +11,20 @@ steps: commands: - rustup component add rustfmt - cargo +nightly fmt -- --check + + leptos_fmt: + image: *rust_image + commands: + - *install_binstall + - cargo binstall -y leptosfmt + - leptosfmt -c .leptosfmt.toml --check src + when: + - event: pull_request + + toml_fmt: + image: tamasfe/taplo:0.8.1 + commands: + - taplo format --check when: - event: pull_request diff --git a/Cargo.lock b/Cargo.lock index 345e825..0841931 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1587,7 +1587,7 @@ dependencies = [ [[package]] name = "ibis" -version = "0.1.0" +version = "0.1.1" dependencies = [ "activitypub_federation", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index eaeaf7f..29cb1e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ diesel = { version = "2.1.4", features = [ "postgres", "chrono", "uuid", - "r2d2" + "r2d2", ], optional = true } diesel-derive-newtype = { version = "2.1.0", optional = true } diesel_migrations = { version = "2.1.0", optional = true } @@ -97,5 +97,5 @@ debug = 0 [profile.release] lto = "thin" -strip = true # Automatically strip symbols from the binary. +strip = true # Automatically strip symbols from the binary. #opt-level = "z" # Optimize for size. diff --git a/src/backend/mod.rs b/src/backend/mod.rs index 862ded0..362cf66 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -88,7 +88,7 @@ pub async fn start(config: IbisConfig) -> MyResult<()> { let config = data.clone(); let app = Router::new() - .leptos_routes(&leptos_options, routes, || view! { }) + .leptos_routes(&leptos_options, routes, || view! { }) .with_state(leptos_options) .nest("", asset_routes()?) .nest(FEDERATION_ROUTES_PREFIX, federation_routes()) diff --git a/src/frontend/app.rs b/src/frontend/app.rs index e172534..0df1bfb 100644 --- a/src/frontend/app.rs +++ b/src/frontend/app.rs @@ -90,30 +90,30 @@ pub fn App() -> impl IntoView { provide_context(create_rw_signal(global_state)); view! { - <> - - - -