Skip to content

Commit

Permalink
Make CI fail on any occurrence of rust-tomlfmt failed (apache#7774)
Browse files Browse the repository at this point in the history
* Make CI fail on any occurrence of rust-tomlfmt failed

* Fix the format of datafusion/sqllogictest/Cargo.toml
  • Loading branch information
ongchi authored Oct 13, 2023
1 parent 81c915c commit e0fa75f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 26 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,11 @@ jobs:

- name: Check Cargo.toml formatting
run: |
# if you encounter error, try rerun the command below, finally run 'git diff' to
# check which Cargo.toml introduces formatting violation
# if you encounter an error, try running 'cargo tomlfmt -p path/to/Cargo.toml' to fix the formatting automatically.
# If the error still persists, you need to manually edit the Cargo.toml file, which introduces formatting violation.
#
# ignore ./Cargo.toml because putting workspaces in multi-line lists make it easy to read
ci/scripts/rust_toml_fmt.sh
git diff --exit-code
config-docs-check:
name: check configs.md is up-to-date
Expand Down
8 changes: 7 additions & 1 deletion ci/scripts/rust_toml_fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@
# specific language governing permissions and limitations
# under the License.

# Run cargo-tomlfmt with flag `-d` in dry run to check formatting
# without overwritng the file. If any error occur, you may want to
# rerun 'cargo tomlfmt -p path/to/Cargo.toml' without '-d' to fix
# the formatting automatically.
set -ex
find . -mindepth 2 -name 'Cargo.toml' -exec cargo tomlfmt -p {} \;
for toml in $(find . -mindepth 2 -name 'Cargo.toml'); do
cargo tomlfmt -d -p $toml
done
44 changes: 22 additions & 22 deletions datafusion/sqllogictest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,46 @@
# under the License.

[package]
authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
name = "datafusion-sqllogictest"
readme.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true
readme = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }

[lib]
name = "datafusion_sqllogictest"
path = "src/lib.rs"

[dependencies]
arrow = {workspace = true}
arrow = { workspace = true }
async-trait = "0.1.41"
bigdecimal = "0.4.1"
datafusion = {path = "../core", version = "32.0.0"}
datafusion-common = {path = "../common", version = "32.0.0", default-features = false}
bytes = { version = "1.4.0", optional = true }
chrono = { workspace = true, optional = true }
datafusion = { path = "../core", version = "32.0.0" }
datafusion-common = { path = "../common", version = "32.0.0", default-features = false }
futures = { version = "0.3.28" }
half = "2.2.1"
itertools = "0.11"
object_store = "0.7.0"
rust_decimal = {version = "1.27.0"}
log = "^0.4"
object_store = "0.7.0"
postgres-protocol = { version = "0.6.4", optional = true }
postgres-types = { version = "0.2.4", optional = true }
rust_decimal = { version = "1.27.0" }
sqllogictest = "0.17.0"
sqlparser.workspace = true
sqlparser = { workspace = true }
tempfile = "3"
thiserror = "1.0.44"
tokio = {version = "1.0"}
bytes = {version = "1.4.0", optional = true}
futures = {version = "0.3.28"}
chrono = { workspace = true, optional = true }
tokio-postgres = {version = "0.7.7", optional = true}
postgres-types = {version = "0.2.4", optional = true}
postgres-protocol = {version = "0.6.4", optional = true}
tokio = { version = "1.0" }
tokio-postgres = { version = "0.7.7", optional = true }

[features]
postgres = ["bytes", "chrono", "tokio-postgres", "postgres-types", "postgres-protocol"]
avro = ["datafusion/avro"]
postgres = ["bytes", "chrono", "tokio-postgres", "postgres-types", "postgres-protocol"]

[dev-dependencies]
env_logger = "0.10"
Expand Down

0 comments on commit e0fa75f

Please sign in to comment.