From 2bdb26d7d34a499b392b4a5ee5b42f288a7ddd79 Mon Sep 17 00:00:00 2001 From: gibbz00 Date: Sun, 21 Apr 2024 12:41:16 +0200 Subject: [PATCH] ci: Add TOML validation with `taplo` --- .github/workflows/ci.yml | 12 ++++++++++++ Cargo.toml | 8 ++++---- clippy.toml | 2 +- conformance/Cargo.toml | 4 ++-- fuzz/Cargo.toml | 4 ++-- prost-build/Cargo.toml | 8 ++++---- prost-derive/Cargo.toml | 10 +++++----- prost-types/Cargo.toml | 8 ++++---- protobuf/Cargo.toml | 4 ++-- taplo.toml | 2 ++ tests-2015/Cargo.toml | 4 ++-- tests-no-std/Cargo.toml | 4 ++-- tests/Cargo.toml | 4 ++-- 13 files changed, 44 insertions(+), 30 deletions(-) create mode 100644 taplo.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ca8d776b..dcdbb336a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,18 @@ jobs: components: rustfmt - run: cargo fmt --all --check + toml_validation: + runs-on: ubuntu-latest + container: + image: tamasfe/taplo:0.8.1 + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: taplo lint + run: taplo lint + - name: taplo fmt + run: taplo fmt --check --diff + clippy: runs-on: ubuntu-latest steps: diff --git a/Cargo.toml b/Cargo.toml index f93ae8156..ad7e77c41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,10 +2,10 @@ name = "prost" version = "0.12.4" authors = [ - "Dan Burkert ", - "Lucio Franco ", - "Casper Meijn ", - "Tokio Contributors ", + "Dan Burkert ", + "Lucio Franco ", + "Casper Meijn ", + "Tokio Contributors ", ] license = "Apache-2.0" repository = "https://github.com/tokio-rs/prost" diff --git a/clippy.toml b/clippy.toml index 5988e12d8..ba34bf464 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -too-many-arguments-threshold=8 +too-many-arguments-threshold = 8 diff --git a/conformance/Cargo.toml b/conformance/Cargo.toml index 5333b64fa..6338e12bb 100644 --- a/conformance/Cargo.toml +++ b/conformance/Cargo.toml @@ -2,8 +2,8 @@ name = "conformance" version = "0.0.0" authors = [ - "Dan Burkert ", - "Tokio Contributors ", + "Dan Burkert ", + "Tokio Contributors ", ] publish = false edition = "2018" diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index faedb3a2d..eebda45d2 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -2,8 +2,8 @@ name = "fuzz" version = "0.0.0" authors = [ - "Dan Burkert ", - "Tokio Contributors ", + "Dan Burkert ", + "Tokio Contributors ", ] publish = false edition = "2018" diff --git a/prost-build/Cargo.toml b/prost-build/Cargo.toml index aaf6698d7..3d17d121a 100644 --- a/prost-build/Cargo.toml +++ b/prost-build/Cargo.toml @@ -2,10 +2,10 @@ name = "prost-build" version = "0.12.4" authors = [ - "Dan Burkert ", - "Lucio Franco ", - "Casper Meijn ", - "Tokio Contributors ", + "Dan Burkert ", + "Lucio Franco ", + "Casper Meijn ", + "Tokio Contributors ", ] license = "Apache-2.0" repository = "https://github.com/tokio-rs/prost" diff --git a/prost-derive/Cargo.toml b/prost-derive/Cargo.toml index a9ef2da63..5ca961131 100644 --- a/prost-derive/Cargo.toml +++ b/prost-derive/Cargo.toml @@ -2,10 +2,10 @@ name = "prost-derive" version = "0.12.4" authors = [ - "Dan Burkert ", - "Lucio Franco ", - "Casper Meijn ", - "Tokio Contributors ", + "Dan Burkert ", + "Lucio Franco ", + "Casper Meijn ", + "Tokio Contributors ", ] license = "Apache-2.0" repository = "https://github.com/tokio-rs/prost" @@ -23,4 +23,4 @@ anyhow = "1.0.1" itertools = { version = ">=0.10, <=0.12", default-features = false, features = ["use_alloc"] } proc-macro2 = "1" quote = "1" -syn = { version = "2", features = [ "extra-traits" ] } +syn = { version = "2", features = ["extra-traits"] } diff --git a/prost-types/Cargo.toml b/prost-types/Cargo.toml index cfd645435..5825f68c6 100644 --- a/prost-types/Cargo.toml +++ b/prost-types/Cargo.toml @@ -2,10 +2,10 @@ name = "prost-types" version = "0.12.4" authors = [ - "Dan Burkert ", - "Lucio Franco ", - "Casper Meijn ", - "Tokio Contributors ", + "Dan Burkert ", + "Lucio Franco ", + "Casper Meijn ", + "Tokio Contributors ", ] license = "Apache-2.0" repository = "https://github.com/tokio-rs/prost" diff --git a/protobuf/Cargo.toml b/protobuf/Cargo.toml index 682f17285..3a02cb951 100644 --- a/protobuf/Cargo.toml +++ b/protobuf/Cargo.toml @@ -2,8 +2,8 @@ name = "protobuf" version = "0.0.0" authors = [ - "Dan Burkert ", - "Tokio Contributors ", + "Dan Burkert ", + "Tokio Contributors ", ] publish = false edition = "2018" diff --git a/taplo.toml b/taplo.toml new file mode 100644 index 000000000..65948ab78 --- /dev/null +++ b/taplo.toml @@ -0,0 +1,2 @@ +[formatting] +inline_table_expand = false diff --git a/tests-2015/Cargo.toml b/tests-2015/Cargo.toml index cdb48cabf..9b6b620cc 100644 --- a/tests-2015/Cargo.toml +++ b/tests-2015/Cargo.toml @@ -2,8 +2,8 @@ name = "tests-2015" version = "0.0.0" authors = [ - "Dan Burkert ", - "Tokio Contributors ", + "Dan Burkert ", + "Tokio Contributors ", ] publish = false edition = "2015" diff --git a/tests-no-std/Cargo.toml b/tests-no-std/Cargo.toml index d8fc10d64..9ffc23935 100644 --- a/tests-no-std/Cargo.toml +++ b/tests-no-std/Cargo.toml @@ -2,8 +2,8 @@ name = "tests-no-std" version = "0.0.0" authors = [ - "Dan Burkert ", - "Tokio Contributors ", + "Dan Burkert ", + "Tokio Contributors ", ] publish = false edition = "2018" diff --git a/tests/Cargo.toml b/tests/Cargo.toml index edc2fa86e..79e5a2b84 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -2,8 +2,8 @@ name = "tests" version = "0.0.0" authors = [ - "Dan Burkert ", - "Tokio Contributors ", + "Dan Burkert ", + "Tokio Contributors ", ] publish = false edition = "2018"