From bccb0bc6b9f0a28569c3cc65ad5495db1e10df20 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 14 Mar 2025 23:25:39 +0700 Subject: [PATCH] Add Taplo formatting for TOML files See https://github.com/linebender/xilem/pull/784 and https://xi.zulipchat.com/#narrow/channel/419691-linebender/topic/Taplo.3A.20TOML.20formatting --- .github/workflows/ci.yml | 8 ++++++++ .taplo.toml | 11 +++++++++++ fontique/Cargo.toml | 34 ++++++++++++++++++++++++++-------- 3 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 .taplo.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b3e1d47..21a80ac1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,6 +77,14 @@ jobs: - name: cargo fmt run: cargo fmt --all --check + - name: Install Taplo + uses: uncenter/setup-taplo@09968a8ae38d66ddd3d23802c44bf6122d7aa991 # v1 + with: + version: "0.9.3" + + - name: Run taplo fmt + run: taplo fmt --check --diff + - name: install ripgrep run: | sudo apt update diff --git a/.taplo.toml b/.taplo.toml new file mode 100644 index 00000000..f0130461 --- /dev/null +++ b/.taplo.toml @@ -0,0 +1,11 @@ +# See https://taplo.tamasfe.dev/configuration/file.html +# and https://taplo.tamasfe.dev/configuration/formatter-options.html + +[formatting] +# Aligning comments with the largest line creates +# diff noise when neighboring lines are changed. +align_comments = false + +# Matches how rustfmt formats Rust code +column_width = 100 +indent_string = " " diff --git a/fontique/Cargo.toml b/fontique/Cargo.toml index 4d9f807e..5ccaef0f 100644 --- a/fontique/Cargo.toml +++ b/fontique/Cargo.toml @@ -23,10 +23,14 @@ icu_properties = ["dep:icu_properties"] unicode_script = ["dep:unicode-script"] # Enables support for system font backends system = [ - "std", - "dep:windows", "dep:windows-core", - "dep:objc2-core-foundation", "dep:objc2-core-text", "dep:objc2-foundation", - "dep:fontconfig-cache-parser", "dep:roxmltree", + "std", + "dep:windows", + "dep:windows-core", + "dep:objc2-core-foundation", + "dep:objc2-core-text", + "dep:objc2-foundation", + "dep:fontconfig-cache-parser", + "dep:roxmltree", ] [dependencies] @@ -42,13 +46,27 @@ icu_locid = "1.5.0" hashbrown = { workspace = true } [target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.58.0", features = ["implement", "Win32_Graphics_DirectWrite"], optional = true } +windows = { version = "0.58.0", features = [ + "implement", + "Win32_Graphics_DirectWrite", +], optional = true } windows-core = { version = "0.58", optional = true } [target.'cfg(target_vendor = "apple")'.dependencies] -objc2-foundation = { version = "0.3.0", optional = true, default-features = false, features = ["alloc", "NSArray", "NSEnumerator", "NSPathUtilities", "NSString"] } -objc2-core-foundation = { version = "0.3.0", optional = true, default-features = false, features = ["CFBase"] } -objc2-core-text = { version = "0.3.0", optional = true, default-features = false, features = ["CTFont", "CTFontDescriptor"] } +objc2-foundation = { version = "0.3.0", optional = true, default-features = false, features = [ + "alloc", + "NSArray", + "NSEnumerator", + "NSPathUtilities", + "NSString", +] } +objc2-core-foundation = { version = "0.3.0", optional = true, default-features = false, features = [ + "CFBase", +] } +objc2-core-text = { version = "0.3.0", optional = true, default-features = false, features = [ + "CTFont", + "CTFontDescriptor", +] } [target.'cfg(target_os = "linux")'.dependencies] fontconfig-cache-parser = { version = "0.2.0", optional = true }