From cbaeb4e00a35f1b00d3e43d6e1c002e2856c9215 Mon Sep 17 00:00:00 2001 From: gentoo90 Date: Sat, 11 Jan 2025 11:00:48 -0800 Subject: [PATCH] CI: check `Cargo.toml` formatting --- .github/workflows/ci.yaml | 10 +++++++++- .taplo.toml | 4 ++++ Cargo.toml | 12 +++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .taplo.toml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7da6696..eb47a92 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -107,7 +107,15 @@ jobs: with: command: update args: --package num-traits --precise 0.2.18 - - name: Check formatting + - name: Setup Taplo + if: matrix.lint + uses: uncenter/setup-taplo@v1 + with: + version: "0.8.1" + - name: Check Cargo.toml formatting + if: matrix.lint + run: taplo fmt --check --diff + - name: Check sourcecode formatting if: matrix.lint uses: actions-rs/cargo@v1 with: diff --git a/.taplo.toml b/.taplo.toml new file mode 100644 index 0000000..9f967cb --- /dev/null +++ b/.taplo.toml @@ -0,0 +1,4 @@ +include = [".taplo.toml", "Cargo.toml"] + +[formatting] +indent_string = " " diff --git a/Cargo.toml b/Cargo.toml index 4053556..10d90eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,17 @@ categories = ["api-bindings", "os::windows-apis"] [dependencies] cfg-if = "1.0" -winapi = { version = "0.3.9", features = ["impl-default", "impl-debug", "minwindef", "minwinbase", "timezoneapi", "winerror", "winnt", "winreg", "handleapi"] } +winapi = { version = "0.3.9", features = [ + "impl-default", + "impl-debug", + "minwindef", + "minwinbase", + "timezoneapi", + "winerror", + "winnt", + "winreg", + "handleapi", +] } chrono = { version = "0.4.6", optional = true } serde = { version = "1", optional = true }