From a7437e5e924241cee71917cfe6553b4cd78f55f1 Mon Sep 17 00:00:00 2001 From: tyler Date: Wed, 17 Jan 2024 03:18:36 +0000 Subject: [PATCH 1/3] Add formatting for toml files --- Cargo.toml | 3 +-- Makefile | 8 +++++++- crates/catalog/hms/Cargo.toml | 10 +++++----- crates/catalog/rest/Cargo.toml | 13 ++++++------- crates/iceberg/Cargo.toml | 12 ++++++------ crates/test_utils/Cargo.toml | 10 +++++----- website/book.toml | 2 +- 7 files changed, 31 insertions(+), 27 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b0b1726a9..2758143ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ version = "0.1.0" edition = "2021" homepage = "https://rust.iceberg.apache.org/" -repository = "https://github.com/apache/iceberg-rust" +repository = "https://github.com/apache/iceberg-rust" license = "Apache-2.0" [workspace.dependencies] @@ -69,4 +69,3 @@ urlencoding = "2" uuid = "1.6.1" tera = "1" - diff --git a/Makefile b/Makefile index c34f6c97d..29b9fd61d 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,8 @@ RUST_LOG = debug +tomlfiles := $(shell find . -name '*.toml') + build: cargo build @@ -32,7 +34,11 @@ cargo-sort: cargo install cargo-sort cargo sort -c -w -check: check-fmt check-clippy cargo-sort +fmt-toml: + cargo install taplo-cli --locked + $(foreach x, $(tomlfiles), $(shell taplo fmt $x)) + +check: check-fmt check-clippy cargo-sort fmt-toml unit-test: cargo test --no-fail-fast --lib --all-features --workspace diff --git a/crates/catalog/hms/Cargo.toml b/crates/catalog/hms/Cargo.toml index b35dd5aeb..693d4e947 100644 --- a/crates/catalog/hms/Cargo.toml +++ b/crates/catalog/hms/Cargo.toml @@ -17,14 +17,14 @@ [package] name = "iceberg-catalog-hms" -version = { workspace = true } -edition = { workspace = true } -homepage = { workspace = true } +version = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } categories = ["database"] description = "Apache Iceberg Hive Metastore Catalog Support" -repository = { workspace = true } -license = { workspace = true } +repository = { workspace = true } +license = { workspace = true } keywords = ["iceberg", "hive", "catalog"] [dependencies] diff --git a/crates/catalog/rest/Cargo.toml b/crates/catalog/rest/Cargo.toml index 31017de06..b0a8be67b 100644 --- a/crates/catalog/rest/Cargo.toml +++ b/crates/catalog/rest/Cargo.toml @@ -16,15 +16,15 @@ # under the License. [package] -name = "iceberg-catalog-rest" -version = { workspace = true } -edition = { workspace = true } -homepage = { workspace = true } +name = "iceberg-catalog-rest" +version = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } categories = ["database"] description = "Apache Iceberg Rust REST API" -repository = { workspace = true } -license = { workspace = true } +repository = { workspace = true } +license = { workspace = true } keywords = ["iceberg", "rest", "catalog"] [dependencies] @@ -46,4 +46,3 @@ iceberg_test_utils = { path = "../../test_utils", features = ["tests"] } mockito = { workspace = true } port_scanner = { workspace = true } tokio = { workspace = true } - diff --git a/crates/iceberg/Cargo.toml b/crates/iceberg/Cargo.toml index 8317c4711..433c7bb9f 100644 --- a/crates/iceberg/Cargo.toml +++ b/crates/iceberg/Cargo.toml @@ -16,15 +16,15 @@ # under the License. [package] -name = "iceberg" -version = { workspace = true } -edition = { workspace = true } -homepage = { workspace = true } +name = "iceberg" +version = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } categories = ["database"] description = "Apache Iceberg Rust implementation" -repository = { workspace = true } -license = { workspace = true } +repository = { workspace = true } +license = { workspace = true } keywords = ["iceberg"] [dependencies] diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml index 420c9ca71..9d396a624 100644 --- a/crates/test_utils/Cargo.toml +++ b/crates/test_utils/Cargo.toml @@ -17,12 +17,12 @@ [package] name = "iceberg_test_utils" -version = { workspace = true } -edition = { workspace = true } -homepage = { workspace = true } +version = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } -repository = { workspace = true } -license = { workspace = true } +repository = { workspace = true } +license = { workspace = true } [dependencies] env_logger = { workspace = true } diff --git a/website/book.toml b/website/book.toml index 780208159..e8a90c721 100644 --- a/website/book.toml +++ b/website/book.toml @@ -27,4 +27,4 @@ git-repository-url = "https://github.com/apache/iceberg-rust" git-repository-icon = "fa-github" edit-url-template = "https://github.com/apache/iceberg-rust/edit/main/website/{path}" cname = "rust.iceberg.apache.org" -no-section-label = true \ No newline at end of file +no-section-label = true From b0658964945ae80380e361888a88894a93a88323 Mon Sep 17 00:00:00 2001 From: tyler Date: Tue, 16 Jan 2024 22:29:37 -0500 Subject: [PATCH 2/3] Update call to taplo --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 29b9fd61d..c699bb1ab 100644 --- a/Makefile +++ b/Makefile @@ -19,8 +19,6 @@ RUST_LOG = debug -tomlfiles := $(shell find . -name '*.toml') - build: cargo build @@ -36,7 +34,7 @@ cargo-sort: fmt-toml: cargo install taplo-cli --locked - $(foreach x, $(tomlfiles), $(shell taplo fmt $x)) + taplo fmt check: check-fmt check-clippy cargo-sort fmt-toml From 7615116371865adc8b2e6d4c2a1d878246bc66ba Mon Sep 17 00:00:00 2001 From: tyler Date: Wed, 17 Jan 2024 19:18:16 -0500 Subject: [PATCH 3/3] Add command to format and a command to check --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c699bb1ab..d411cceb8 100644 --- a/Makefile +++ b/Makefile @@ -32,11 +32,15 @@ cargo-sort: cargo install cargo-sort cargo sort -c -w -fmt-toml: +fix-toml: cargo install taplo-cli --locked taplo fmt -check: check-fmt check-clippy cargo-sort fmt-toml +check-toml: + cargo install taplo-cli --locked + taplo check + +check: check-fmt check-clippy cargo-sort check-toml unit-test: cargo test --no-fail-fast --lib --all-features --workspace