From 7affdd8e09d93a0388417a7d54cc233f1551db99 Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Mon, 3 Feb 2025 11:47:58 +0000 Subject: [PATCH] Add Taplo formatting for TOML files (#809) 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 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .taplo.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8aab9a24..db6cca4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,6 +74,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 = " "