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

feat: add cargo-sort to the CI pipeline #163

Merged
merged 3 commits into from
Jul 7, 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
2 changes: 1 addition & 1 deletion .config/hakari.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dep-format-version = "2"
exact-versions = true
hakari-package = "manta-workspace-hack"
hakari-package = "workspace-hack"
platforms = []
resolver = "2"
21 changes: 15 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings -A unknown-lints
RUSTFLAGS: -D warnings
RUST_BACKTRACE: full
jobs:
workspace-hack-check:
Expand All @@ -31,16 +31,25 @@ jobs:
- uses: actions/checkout@v3
- run: rustup update nightly && rustup default nightly && rustup component add rustfmt
- run: cargo fmt --all -- --check
format-cargo-toml:
name: Format Crate Configuration Files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update nightly && rustup default nightly
- run: cargo install cargo-sort
- run: cargo sort workspace-hack
- run: cargo sort --workspace --check
docs:
name: Docs
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update nightly && rustup default nightly
- run: RUSTDOCFLAGS="-D warnings --cfg doc_cfg" cargo +nightly doc --workspace --all-features --no-deps --document-private-items
lint:
name: Lint (${{ matrix.os }} + ${{ matrix.channel }})
needs: [workspace-hack-check, format, docs]
needs: [workspace-hack-check, format, format-cargo-toml, docs]
strategy:
fail-fast: false
matrix:
Expand All @@ -60,7 +69,7 @@ jobs:
- run: cargo hack clippy --workspace --feature-powerset --tests
test:
name: Test (${{ matrix.os }} + ${{ matrix.channel }})
needs: [workspace-hack-check, format, docs]
needs: [workspace-hack-check, format, format-cargo-toml, docs]
strategy:
fail-fast: false
matrix:
Expand All @@ -78,8 +87,8 @@ jobs:
- run: cargo install cargo-nextest
- run: cargo nextest run --workspace --release --all-features
compile-bench:
name: Compile Bench (${{ matrix.os }} + ${{ matrix.channel }})
needs: [workspace-hack-check, format, docs]
name: Compile Benchmarks (${{ matrix.os }} + ${{ matrix.channel }})
needs: [workspace-hack-check, format, format-cargo-toml, docs]
strategy:
fail-fast: false
matrix:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [\#144](https://github.com/Manta-Network/manta-rs/pull/144) Add new release PR template for future releases
- [\#145](https://github.com/Manta-Network/manta-rs/pull/145) Add `cargo-hakari` and `cargo-nextest` to speed up CI pipeline
- [\#147](https://github.com/Manta-Network/manta-rs/pull/147) Add benchmarks for Arkworks elliptic curve operations
- [\#163](https://github.com/Manta-Network/manta-rs/pull/163) Add `cargo-sort` to the CI pipeline for formatting `Cargo.toml` files

### Changed
- [\#152](https://github.com/Manta-Network/manta-rs/pull/152) Make `format` and `docs` as prerequisites for the rest of the CI pipeline
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[workspace]
resolver = "2"
members = ["manta-*"]
members = ["manta-*", "workspace-hack"]
2 changes: 1 addition & 1 deletion manta-accounting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ futures = { version = "0.3.21", optional = true, default-features = false, featu
indexmap = { version = "1.8.0", optional = true, default-features = false }
manta-crypto = { path = "../manta-crypto", default-features = false }
manta-util = { path = "../manta-util", default-features = false, features = ["alloc"] }
manta-workspace-hack = { version = "0.1.0", path = "../manta-workspace-hack" }
parking_lot = { version = "0.12.0", optional = true, default-features = false }
rand_chacha = { version = "0.3.1", optional = true, default-features = false }
statrs = { version = "0.15.0", optional = true, default-features = false }
workspace-hack = { version = "0.1.0", path = "../workspace-hack" }

[dev-dependencies]
manta-crypto = { path = "../manta-crypto", default-features = false, features = ["getrandom"] }
2 changes: 0 additions & 2 deletions manta-accounting/src/wallet/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,11 @@ impl BalanceState for AssetList {
self.value(id)
}

#[allow(clippy::only_used_in_recursion)] // NOTE: False-positive: rust-clippy/issues/8560
#[inline]
fn deposit(&mut self, asset: Asset) {
self.deposit(asset);
}

#[allow(clippy::only_used_in_recursion)] // NOTE: False-positive: rust-clippy/issues/8560
#[inline]
fn withdraw(&mut self, asset: Asset) -> bool {
self.withdraw(asset)
Expand Down
2 changes: 1 addition & 1 deletion manta-benchmark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ instant = { version = "0.1.12", default-features = false, features = [ "wasm-bin
manta-accounting = { path = "../manta-accounting", default-features = false, features = ["test"] }
manta-crypto = { path = "../manta-crypto", default-features = false, features = ["getrandom", "test"] }
manta-pay = { path = "../manta-pay", default-features = false, features = ["groth16", "test"] }
manta-workspace-hack = { version = "0.1.0", path = "../manta-workspace-hack" }
wasm-bindgen = { version = "0.2.81", default-features = false }
wasm-bindgen-test = { version = "0.3.30", default-features = false }
web-sys = { version = "0.3.58", default-features = false, features = ["console"] }
workspace-hack = { version = "0.1.0", path = "../workspace-hack" }

[dev-dependencies]
criterion = { version = "0.3.4", default-features = false }
2 changes: 1 addition & 1 deletion manta-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ test = []
[dependencies]
derivative = { version = "2.2.0", default-features = false, features = ["use_core"] }
manta-util = { path = "../manta-util", default-features = false, features = ["alloc"] }
manta-workspace-hack = { version = "0.1.0", path = "../manta-workspace-hack" }
rand = { version = "0.8.4", optional = true, default-features = false, features = ["alloc"] }
rand_core = { version = "0.6.3", default-features = false }
workspace-hack = { version = "0.1.0", path = "../workspace-hack" }

[dev-dependencies]
rand = "0.8.4"
3 changes: 0 additions & 3 deletions manta-crypto/src/merkle_tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

//! Merkle Trees and Forests

// NOTE: clippy false-positive: https://github.com/rust-lang/rust-clippy/pull/8869
#![allow(clippy::derive_partial_eq_without_eq)]

// FIXME: Get rid of as many `pub(super)` declarations as we can.
// TODO: Should `Leaf` move into `Tree`/`Configuration` since we might want the tree to have
// special kinds of leaf input (metadata along with just the digest)?
Expand Down
2 changes: 1 addition & 1 deletion manta-parameters/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ std = ["anyhow?/std"]
anyhow = { version = "1.0.57", optional = true, default-features = false }
attohttpc = { version = "0.19.1", optional = true }
blake3 = { version = "1.3.1", default-features = false }
manta-workspace-hack = { version = "0.1.0", path = "../manta-workspace-hack" }
workspace-hack = { version = "0.1.0", path = "../workspace-hack" }

[dev-dependencies]
git2 = { version = "0.14.4", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion manta-pay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ manta-accounting = { path = "../manta-accounting", default-features = false }
manta-crypto = { path = "../manta-crypto", default-features = false }
manta-parameters = { path = "../manta-parameters", optional = true, default-features = false }
manta-util = { path = "../manta-util", default-features = false }
manta-workspace-hack = { version = "0.1.0", path = "../manta-workspace-hack" }
parking_lot = { version = "0.12.1", optional = true, default-features = false }
rand_chacha = { version = "0.3.1", default-features = false }
rayon = { version = "1.5.1", optional = true, default-features = false }
Expand All @@ -137,6 +136,7 @@ tempfile = { version = "3.3.0", optional = true, default-features = false }
tide = { version = "0.16.0", optional = true, default-features = false, features = ["h1-server"] }
tokio = { version = "1.18.2", optional = true, default-features = false }
tokio-tungstenite = { version = "0.17.1", optional = true, default-features = false, features = ["native-tls"] }
workspace-hack = { version = "0.1.0", path = "../workspace-hack" }
ws_stream_wasm = { version = "0.7.3", optional = true, default-features = false }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion manta-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ std = ["alloc"]

[dependencies]
crossbeam-channel = { version = "0.5.4", optional = true, default-features = false }
manta-workspace-hack = { version = "0.1.0", path = "../manta-workspace-hack" }
rayon = { version = "1.5.3", optional = true, default-features = false }
serde = { version = "1.0.138", optional = true, default-features = false, features = ["derive"] }
serde_with = { version = "1.14.0", optional = true, default-features = false, features = ["macros"] }
workspace-hack = { version = "0.1.0", path = "../workspace-hack" }
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# cargo hakari generate

[package]
name = "manta-workspace-hack"
name = "workspace-hack"
version = "0.1.0"
description = "workspace-hack package, managed by hakari"
# You can choose to publish this crate: see https://docs.rs/cargo-hakari/latest/cargo_hakari/publishing.
Expand Down
File renamed without changes.
File renamed without changes.