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

use cargo-tomlfmt to check Cargo.toml formatting in CI #2033

Merged
merged 4 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
53 changes: 53 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,59 @@ jobs:
env:
CARGO_HOME: "/github/home/.cargo"
CARGO_TARGET_DIR: "/github/home/target"

cargo-toml-formatting-checks:
name: Check Cargo.toml formatting
needs: [linux-build-lib]
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64]
rust: [stable]
container:
image: ${{ matrix.arch }}/rust
env:
# Disable full debug symbol generation to speed up CI build and keep memory down
# "1" means line tables only, which is useful for panic tracebacks.
RUSTFLAGS: "-C debuginfo=1"
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v2
with:
path: /github/home/.cargo
# this key equals the ones on `linux-build-lib` for re-use
key: cargo-cache-
- name: Cache Rust dependencies
uses: actions/cache@v2
with:
path: /github/home/target
# this key equals the ones on `linux-build-lib` for re-use
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache-${{ matrix.rust }}
- name: Setup Rust toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
- name: Install cargo-tomlfmt
run: |
which cargo-tomlfmt || cargo install cargo-tomlfmt
env:
CARGO_HOME: "/github/home/.cargo"
CARGO_TARGET_DIR: "/github/home/target"
- 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
#
# ignore ./Cargo.toml because putting workspaces in multi-line lists make it easy to read
find . -mindepth 2 -name 'Cargo.toml' -exec cargo tomlfmt -p {} \;
git diff --exit-code
env:
CARGO_HOME: "/github/home/.cargo"
CARGO_TARGET_DIR: "/github/home/target"

# Coverage job was failing. https://github.com/apache/arrow-datafusion/issues/590 tracks re-instating it

# coverage:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ members = [
]

[profile.release]
lto = true
codegen-units = 1
lto = true
8 changes: 4 additions & 4 deletions ballista-examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ publish = false
rust-version = "1.59"

[dependencies]
ballista = { path = "../ballista/rust/client", version = "0.6.0" }
datafusion = { path = "../datafusion" }
ballista = { path = "../ballista/rust/client", version = "0.6.0"}
prost = "0.9"
tonic = "0.6"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot"] }
futures = "0.3"
num_cpus = "1.13.0"
prost = "0.9"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot"] }
tonic = "0.6"
10 changes: 5 additions & 5 deletions ballista/rust/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ rust-version = "1.59"
ballista-core = { path = "../core", version = "0.6.0" }
ballista-executor = { path = "../executor", version = "0.6.0", optional = true }
ballista-scheduler = { path = "../scheduler", version = "0.6.0", optional = true }

datafusion = { path = "../../../datafusion", version = "7.0.0" }
futures = "0.3"
log = "0.4"
tokio = "1.0"
tempfile = "3"
sqlparser = "0.15"
parking_lot = "0.12"

datafusion = { path = "../../../datafusion", version = "7.0.0" }
sqlparser = "0.15"
tempfile = "3"
tokio = "1.0"

[features]
default = []
Expand Down
20 changes: 10 additions & 10 deletions ballista/rust/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ simd = ["datafusion/simd"]

[dependencies]
ahash = { version = "0.7", default-features = false }

arrow-flight = { version = "10.0" }
async-trait = "0.1.41"
chrono = { version = "0.4", default-features = false }
clap = { version = "3", features = ["derive", "cargo"] }
datafusion = { path = "../../../datafusion", version = "7.0.0" }
datafusion-proto = { path = "../../../datafusion-proto", version = "7.0.0" }
futures = "0.3"
hashbrown = "0.12"
log = "0.4"

parking_lot = "0.12"
parse_arg = "0.1.3"
prost = "0.9"
prost-types = "0.9"
serde = {version = "1", features = ["derive"]}
serde = { version = "1", features = ["derive"] }
sqlparser = "0.15"
tokio = "1.0"
tonic = "0.6"
uuid = { version = "0.8", features = ["v4"] }
chrono = { version = "0.4", default-features = false }
clap = { version = "3", features = ["derive", "cargo"] }
parse_arg = "0.1.3"

arrow-flight = { version = "10.0" }
datafusion = { path = "../../../datafusion", version = "7.0.0" }
datafusion-proto = { path = "../../../datafusion-proto", version = "7.0.0" }

parking_lot = "0.12"

[dev-dependencies]
tempfile = "3"
Expand Down
18 changes: 9 additions & 9 deletions ballista/rust/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,38 @@ repository = "https://github.com/apache/arrow-datafusion"
authors = ["Apache Arrow <dev@arrow.apache.org>"]
edition = "2018"

[package.metadata.configure_me.bin]
executor = "executor_config_spec.toml"

[features]
snmalloc = ["snmalloc-rs"]

[dependencies]
arrow = { version = "10.0" }
arrow-flight = { version = "10.0" }
anyhow = "1"
arrow = { version = "10.0" }
arrow-flight = { version = "10.0" }
async-trait = "0.1.41"
ballista-core = { path = "../core", version = "0.6.0" }
chrono = { version = "0.4", default-features = false }
configure_me = "0.4.0"
datafusion = { path = "../../../datafusion", version = "7.0.0" }
env_logger = "0.9"
futures = "0.3"
hyper = "0.14.4"
log = "0.4"
snmalloc-rs = {version = "0.2", optional = true}
parking_lot = "0.12"
snmalloc-rs = { version = "0.2", optional = true }
tempfile = "3"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "parking_lot"] }
tokio-stream = { version = "0.1", features = ["net"] }
tonic = "0.6"
uuid = { version = "0.8", features = ["v4"] }
hyper = "0.14.4"
parking_lot = "0.12"
chrono = { version = "0.4", default-features = false }

[dev-dependencies]

[build-dependencies]
configure_me_codegen = "0.4.0"

[package.metadata.configure_me.bin]
executor = "executor_config_spec.toml"

# use libc on unix like platforms to set worker priority in DedicatedExecutor
[target."cfg(unix)".dependencies.libc]
version = "0.2"
14 changes: 7 additions & 7 deletions ballista/rust/scheduler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ repository = "https://github.com/apache/arrow-datafusion"
authors = ["Apache Arrow <dev@arrow.apache.org>"]
edition = "2018"

[package.metadata.configure_me.bin]
scheduler = "scheduler_config_spec.toml"

[features]
default = ["etcd", "sled"]
etcd = ["etcd-client"]
sled = ["sled_package", "tokio-stream"]

[dependencies]
anyhow = "1"
async-recursion = "1.0.0"
async-trait = "0.1.41"
ballista-core = { path = "../core", version = "0.6.0" }
clap = { version = "3", features = ["derive", "cargo"] }
configure_me = "0.4.0"
Expand All @@ -43,19 +48,17 @@ http = "0.2"
http-body = "0.4"
hyper = "0.14.4"
log = "0.4"
parking_lot = "0.12"
parse_arg = "0.1.3"
prost = "0.9"
rand = "0.8"
serde = {version = "1", features = ["derive"]}
serde = { version = "1", features = ["derive"] }
sled_package = { package = "sled", version = "0.34", optional = true }
tokio = { version = "1.0", features = ["full"] }
tokio-stream = { version = "0.1", features = ["net"], optional = true }
tonic = "0.6"
tower = { version = "0.4" }
warp = "0.3"
parking_lot = "0.12"
async-trait = "0.1.41"
async-recursion = "1.0.0"

[dev-dependencies]
ballista-core = { path = "../core", version = "0.6.0" }
Expand All @@ -64,6 +67,3 @@ uuid = { version = "0.8", features = ["v4"] }
[build-dependencies]
configure_me_codegen = "0.4.1"
tonic-build = { version = "0.6" }

[package.metadata.configure_me.bin]
scheduler = "scheduler_config_spec.toml"
12 changes: 6 additions & 6 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ simd = ["datafusion/simd"]
snmalloc = ["snmalloc-rs"]

[dependencies]
datafusion = { path = "../datafusion" }
ballista = { path = "../ballista/rust/client" }
structopt = { version = "0.3", default-features = false }
tokio = { version = "^1.0", features = ["macros", "rt", "rt-multi-thread", "parking_lot"] }
futures = "0.3"
datafusion = { path = "../datafusion" }
env_logger = "0.9"
futures = "0.3"
mimalloc = { version = "0.1", optional = true, default-features = false }
snmalloc-rs = {version = "0.2", optional = true }
num_cpus = "1.13.0"
rand = "0.8.4"
serde = "1.0.136"
serde_json = "1.0.78"
num_cpus = "1.13.0"
snmalloc-rs = { version = "0.2", optional = true }
structopt = { version = "0.3", default-features = false }
tokio = { version = "^1.0", features = ["macros", "rt", "rt-multi-thread", "parking_lot"] }

[dev-dependencies]
ballista-core = { path = "../ballista/rust/core" }
10 changes: 5 additions & 5 deletions datafusion-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ repository = "https://github.com/apache/arrow-datafusion"
rust-version = "1.59"

[dependencies]
arrow = { version = "10.0" }
ballista = { path = "../ballista/rust/client", version = "0.6.0", optional = true }
clap = { version = "3", features = ["derive", "cargo"] }
rustyline = "9.0"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot"] }
datafusion = { path = "../datafusion", version = "7.0.0" }
arrow = { version = "10.0" }
ballista = { path = "../ballista/rust/client", version = "0.6.0", optional=true }
dirs = "4.0.0"
env_logger = "0.9"
mimalloc = { version = "*", default-features = false }
dirs = "4.0.0"
rustyline = "9.0"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot"] }
8 changes: 4 additions & 4 deletions datafusion-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ path = "src/lib.rs"

[features]
avro = ["avro-rs"]
pyarrow = ["pyo3"]
jit = ["cranelift-module"]
pyarrow = ["pyo3"]

[dependencies]
arrow = { version = "10.0", features = ["prettyprint"] }
parquet = { version = "10.0", features = ["arrow"], optional = true }
avro-rs = { version = "0.13", features = ["snappy"], optional = true }
cranelift-module = { version = "0.82.0", optional = true }
ordered-float = "2.10"
parquet = { version = "10.0", features = ["arrow"], optional = true }
pyo3 = { version = "0.16", optional = true }
sqlparser = "0.15"
ordered-float = "2.10"
cranelift-module = { version = "0.82.0", optional = true }
8 changes: 4 additions & 4 deletions datafusion-examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ required-features = ["datafusion/avro"]

[dev-dependencies]
arrow-flight = { version = "10.0" }
async-trait = "0.1.41"
datafusion = { path = "../datafusion" }
prost = "0.9"
tonic = "0.6"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot"] }
futures = "0.3"
num_cpus = "1.13.0"
async-trait = "0.1.41"
prost = "0.9"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot"] }
tonic = "0.6"
4 changes: 2 additions & 2 deletions datafusion-expr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ path = "src/lib.rs"
[features]

[dependencies]
datafusion-common = { path = "../datafusion-common", version = "7.0.0" }
ahash = { version = "0.7", default-features = false }
arrow = { version = "10.0", features = ["prettyprint"] }
datafusion-common = { path = "../datafusion-common", version = "7.0.0" }
sqlparser = "0.15"
ahash = { version = "0.7", default-features = false }
4 changes: 2 additions & 2 deletions datafusion-jit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ path = "src/lib.rs"
jit = []

[dependencies]
datafusion-common = { path = "../datafusion-common", version = "7.0.0", features = ["jit"] }
cranelift = "0.82.0"
cranelift-module = "0.82.0"
cranelift-jit = "0.82.0"
cranelift-module = "0.82.0"
cranelift-native = "0.82.0"
datafusion-common = { path = "../datafusion-common", version = "7.0.0", features = ["jit"] }
parking_lot = "0.12"
20 changes: 10 additions & 10 deletions datafusion-physical-expr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,25 @@ name = "datafusion_physical_expr"
path = "src/lib.rs"

[features]
default = ["crypto_expressions", "regex_expressions", "unicode_expressions"]
crypto_expressions = ["md-5", "sha2", "blake2", "blake3"]
default = ["crypto_expressions", "regex_expressions", "unicode_expressions"]
regex_expressions = ["regex"]
unicode_expressions = ["unicode-segmentation"]

[dependencies]
ahash = { version = "0.7", default-features = false }
arrow = { version = "10.0", features = ["prettyprint"] }
blake2 = { version = "^0.10.2", optional = true }
blake3 = { version = "1.0", optional = true }
chrono = { version = "0.4", default-features = false }
datafusion-common = { path = "../datafusion-common", version = "7.0.0" }
datafusion-expr = { path = "../datafusion-expr", version = "7.0.0" }
arrow = { version = "10.0", features = ["prettyprint"] }
paste = "^1.0"
ahash = { version = "0.7", default-features = false }
ordered-float = "2.10"
hashbrown = { version = "0.12", features = ["raw"] }
lazy_static = { version = "^1.4.0" }
md-5 = { version = "^0.10.0", optional = true }
sha2 = { version = "^0.10.1", optional = true }
blake2 = { version = "^0.10.2", optional = true }
blake3 = { version = "1.0", optional = true }
ordered-float = "2.10"
paste = "^1.0"
rand = "0.8"
hashbrown = { version = "0.12", features = ["raw"] }
chrono = { version = "0.4", default-features = false }
regex = { version = "^1.4.3", optional = true }
sha2 = { version = "^0.10.1", optional = true }
unicode-segmentation = { version = "^1.7.1", optional = true }
Loading