Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add formatting for toml files #167

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -69,4 +69,3 @@ urlencoding = "2"
uuid = "1.6.1"

tera = "1"

6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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
taplo fmt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I think this should be taplo check rather taplo fmt right?

Copy link
Member

@Xuanwo Xuanwo Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I think this should be taplo check rather taplo fmt right?

This job should perform fmt and we can have a check in CI.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, fmt does both check and formatting, will it return non 0 exit code when incorrectly formatted?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, fmt does both check and formatting, will it return non 0 exit code when incorrectly formatted?

I'm guessing not. It will fmt the files directly if it used to be incorrectly formatted.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing not. It will fmt the files directly if it used to be incorrectly formatted.

Than I think it's better to use check here. The goal of ci is to check the correctness, not do formatting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add a command to format and a command to check.


check: check-fmt check-clippy cargo-sort fmt-toml

unit-test:
cargo test --no-fail-fast --lib --all-features --workspace
Expand Down
10 changes: 5 additions & 5 deletions crates/catalog/hms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
13 changes: 6 additions & 7 deletions crates/catalog/rest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -46,4 +46,3 @@ iceberg_test_utils = { path = "../../test_utils", features = ["tests"] }
mockito = { workspace = true }
port_scanner = { workspace = true }
tokio = { workspace = true }

12 changes: 6 additions & 6 deletions crates/iceberg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
10 changes: 5 additions & 5 deletions crates/test_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion website/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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-section-label = true