From 52dd19c65ed5e46ac99af4ea7440a9e6cb0c6b47 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Fri, 14 Feb 2025 10:40:59 +0100 Subject: [PATCH] style: Add TOML formatter Add CI job for taplo (a TOML formatter) --- .github/workflows/ci.yml | 12 ++++++++++++ Cargo.toml | 7 ++----- shellfn-attribute/Cargo.toml | 2 +- taplo.toml | 2 ++ 4 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 taplo.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b26663a..3effb20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,3 +28,15 @@ jobs: toolchain: ${{ env.clippy_rust_version }} components: clippy - run: cargo clippy --workspace --all-targets -- -D warnings + + toml_validation: + runs-on: ubuntu-latest + container: + image: tamasfe/taplo:0.9.3 + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: taplo lint + run: taplo lint + - name: taplo fmt + run: taplo fmt --check --diff diff --git a/Cargo.toml b/Cargo.toml index edb7961..c2c9b5c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,14 +12,11 @@ documentation = "https://docs.rs/shellfn" edition = "2018" [workspace] -members = [ - "shellfn-attribute", - "shellfn-core" -] +members = ["shellfn-attribute", "shellfn-core"] [lib] doctest = false -path = "src/lib.rs" +path = "src/lib.rs" [dependencies] shellfn-attribute = { path = "./shellfn-attribute", version = "0.1.1" } diff --git a/shellfn-attribute/Cargo.toml b/shellfn-attribute/Cargo.toml index c9a6abf..26f6775 100644 --- a/shellfn-attribute/Cargo.toml +++ b/shellfn-attribute/Cargo.toml @@ -17,4 +17,4 @@ quote = "0.6.11" proc-macro2 = "0.4.27" darling = "0.8.3" shellwords = "1.0.0" -shellfn-core = { path = "../shellfn-core", version = "0.1.1" } \ No newline at end of file +shellfn-core = { path = "../shellfn-core", version = "0.1.1" } diff --git a/taplo.toml b/taplo.toml new file mode 100644 index 0000000..ac9464c --- /dev/null +++ b/taplo.toml @@ -0,0 +1,2 @@ +[formatting] +align_entries = true