Skip to content

Commit

Permalink
chore: sort TOML files (#645)
Browse files Browse the repository at this point in the history
Built on top of #644.

I applied the following:

1. Sort keys that were not sorted in the top-level `package` field for
all crates
2. Replace all simple occurrences of a crate version (crate = "x.y.z) or
workspace inheritance (package.workspace = true) with their object-based
counterparts (crate = { version = "x.y.z" } and package = { workspace =
true }) to keep our style consistent
3. Made sure the dependencies are listed as build dependencies first,
then dev dependencies, then regular dependencies for all crates
4. Add the taplo formatter (thanks @Ad96el)

I could not find any plug-ins or tools that would allow us to force any
rules on the TOML files, so we'll have to try and stick with the current
way, and hopefully it's now easier once all crates are consistent and
can be copy-pasted to be used as templates for new ones.

---------

Co-authored-by: Adel Golghalyani <ad96el@gmail.com>
  • Loading branch information
ntn-x2 and Ad96el authored May 23, 2024
1 parent 2dbefd4 commit 193190d
Show file tree
Hide file tree
Showing 41 changed files with 1,817 additions and 1,847 deletions.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ fmt:
stage: test
script:
- cargo fmt -- --check
- cargo install taplo-cli --version 0.9.0
- taplo fmt --check

test:
timeout: 2 hours
Expand Down
6 changes: 3 additions & 3 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# for possible configuration values see https://github.com/rust-lang/rustfmt/blob/master/Configurations.md

hard_tabs = true
imports_granularity = "Crate"
hard_tabs = true
max_width = 120
wrap_comments = true
max_width = 120
wrap_comments = true
7 changes: 7 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exclude = ["target-analyzer/**", "target/**"]

[formatting]
align_entries = true
allowed_blank_lines = 1
reorder_arrays = true
reorder_keys = true
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

406 changes: 204 additions & 202 deletions Cargo.toml

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions crates/assets/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
[package]
authors.workspace = true
documentation.workspace = true
edition.workspace = true
homepage.workspace = true
license-file.workspace = true
readme.workspace = true
repository.workspace = true
version.workspace = true
name = "kilt-asset-dids"
description = "Asset DIDs and related structs, suitable for no_std environments."
authors = { workspace = true }
description = "Asset DIDs and related structs, suitable for no_std environments."
documentation = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license-file = { workspace = true }
name = "kilt-asset-dids"
readme = { workspace = true }
repository = { workspace = true }
version = { workspace = true }

[dependencies]
# External dependencies
base58.workspace = true
hex = {workspace = true, features = ["alloc"]}
hex-literal.workspace = true
log.workspace = true
base58 = { workspace = true }
hex = { workspace = true, features = ["alloc"] }
hex-literal = { workspace = true }
log = { workspace = true }

# Parity dependencies
parity-scale-codec = {workspace = true, features = ["derive"]}
scale-info = {workspace = true, features = ["derive"]}
parity-scale-codec = { workspace = true, features = ["derive"] }
scale-info = { workspace = true, features = ["derive"] }

# Substrate dependencies
frame-support.workspace = true
sp-core.workspace = true
sp-std.workspace = true
frame-support = { workspace = true }
sp-core = { workspace = true }
sp-std = { workspace = true }

[features]
default = ["std"]
std = [
"frame-support/std",
"hex/std",
"log/std",
"parity-scale-codec/std",
"scale-info/std",
"frame-support/std",
"sp-core/std",
"sp-std/std",
]
98 changes: 49 additions & 49 deletions crates/kilt-dip-primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
[package]
authors.workspace = true
description = "Primitive types, traits, and functions for the KILT Decentralized Identity Provider (DIP) functionality as implemented by the KILT blockchain."
documentation.workspace = true
edition.workspace = true
homepage.workspace = true
license-file.workspace = true
name = "kilt-dip-primitives"
readme.workspace = true
repository.workspace = true
version.workspace = true
authors = { workspace = true }
description = "Primitive types, traits, and functions for the KILT Decentralized Identity Provider (DIP) functionality as implemented by the KILT blockchain."
documentation = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license-file = { workspace = true }
name = "kilt-dip-primitives"
readme = { workspace = true }
repository = { workspace = true }
version = { workspace = true }

[dev-dependencies]
cumulus-pallet-parachain-system = { workspace = true, features = ["std"] }
enum-iterator = { workspace = true }
hex-literal = { workspace = true }
peregrine-runtime = { workspace = true, features = ["std"] }
rococo-runtime = { workspace = true, features = ["std"] }
sp-io = { workspace = true, features = ["std"] }
spiritnet-runtime = { workspace = true, features = ["std"] }

[dependencies]
# External dependencies
hash-db.workspace = true
log.workspace = true
hash-db = { workspace = true }
log = { workspace = true }

# Internal dependencies
did.workspace = true
kilt-support = {workspace = true, optional = true}
pallet-did-lookup.workspace = true
pallet-dip-consumer.workspace = true
pallet-dip-provider.workspace = true
pallet-relay-store.workspace = true
pallet-web3-names.workspace = true
did = { workspace = true }
kilt-support = { workspace = true, optional = true }
pallet-did-lookup = { workspace = true }
pallet-dip-consumer = { workspace = true }
pallet-dip-provider = { workspace = true }
pallet-relay-store = { workspace = true }
pallet-web3-names = { workspace = true }

# Parity dependencies
parity-scale-codec = {workspace = true, features = ["derive"]}
scale-info = {workspace = true, features = ["derive"]}
parity-scale-codec = { workspace = true, features = ["derive"] }
scale-info = { workspace = true, features = ["derive"] }

# Substrate dependencies
frame-system.workspace = true
frame-support.workspace = true
sp-core.workspace = true
sp-io.workspace = true
sp-runtime.workspace = true
sp-state-machine.workspace = true
sp-std.workspace = true
sp-trie.workspace = true
frame-support = { workspace = true }
frame-system = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-state-machine = { workspace = true }
sp-std = { workspace = true }
sp-trie = { workspace = true }

# Cumulus dependencies
cumulus-primitives-core.workspace = true

[dev-dependencies]
cumulus-pallet-parachain-system = { workspace = true, features = ["std"] }
enum-iterator.workspace = true
hex-literal.workspace = true
peregrine-runtime = { workspace = true, features = ["std"] }
rococo-runtime = { workspace = true, features = ["std"] }
spiritnet-runtime = { workspace = true, features = ["std"] }
sp-io = { workspace = true, features = ["std"] }
cumulus-primitives-core = { workspace = true }

[features]
default = ["std"]
runtime-benchmarks = [
"kilt-support/runtime-benchmarks",
"pallet-dip-consumer/runtime-benchmarks",
"pallet-dip-provider/runtime-benchmarks",
]
std = [
"hash-db/std",
"log/std",
"cumulus-primitives-core/std",
"did/std",
"frame-support/std",
"frame-system/std",
"hash-db/std",
"kilt-support?/std",
"log/std",
"pallet-did-lookup/std",
"pallet-dip-consumer/std",
"pallet-dip-provider/std",
"pallet-relay-store/std",
"pallet-web3-names/std",
"parity-scale-codec/std",
"scale-info/std",
"frame-system/std",
"frame-support/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-state-machine/std",
"sp-std/std",
"sp-trie/std",
"cumulus-primitives-core/std",
]
runtime-benchmarks = [
"kilt-support/runtime-benchmarks",
"pallet-dip-consumer/runtime-benchmarks",
"pallet-dip-provider/runtime-benchmarks"
]
112 changes: 56 additions & 56 deletions dip-template/nodes/dip-consumer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
[package]
authors.workspace = true
documentation.workspace = true
edition.workspace = true
homepage.workspace = true
license-file.workspace = true
readme.workspace = true
repository.workspace = true
version.workspace = true
name = "dip-consumer-node-template"
description = "Node template for the KILT Decentralized Identity Provider (DIP) consumer."
build = "build.rs"
authors = { workspace = true }
build = "build.rs"
description = "Node template for the KILT Decentralized Identity Provider (DIP) consumer."
documentation = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license-file = { workspace = true }
name = "dip-consumer-node-template"
readme = { workspace = true }
repository = { workspace = true }
version = { workspace = true }

[build-dependencies]
substrate-build-script-utils = { workspace = true }

[dependencies]
clap = {workspace = true, features = ["std", "derive"]}
futures = { workspace = true }
log = { workspace = true, features = ["std"] }
serde = {workspace = true, features = ["std", "derive"]}
jsonrpsee = {workspace = true, features = ["server"]}
clap = { workspace = true, features = ["derive", "std"] }
futures = { workspace = true }
jsonrpsee = { workspace = true, features = ["server"] }
log = { workspace = true, features = ["std"] }
serde = { workspace = true, features = ["derive", "std"] }

# Internal dependencies
dip-consumer-runtime-template = { workspace = true, features = ["std"] }

# Substrate
frame-benchmarking.workspace = true
frame-benchmarking-cli.workspace = true
pallet-transaction-payment-rpc.workspace = true
sc-basic-authorship.workspace = true
sc-chain-spec.workspace = true
sc-cli.workspace = true
sc-client-api.workspace = true
sc-consensus.workspace = true
sc-executor.workspace = true
sc-network.workspace = true
sc-network-sync.workspace = true
sc-offchain.workspace = true
sc-rpc-api.workspace = true
sc-service.workspace = true
sc-sysinfo.workspace = true
sc-telemetry.workspace = true
sc-tracing.workspace = true
sc-transaction-pool.workspace = true
sc-transaction-pool-api.workspace = true
sp-api = { workspace = true, features = ["std"] }
sp-block-builder = { workspace = true, features = ["std"] }
sp-blockchain.workspace = true
sp-consensus-aura = { workspace = true, features = ["std"] }
sp-core = { workspace = true, features = ["std"] }
sp-keystore = { workspace = true, features = ["std"] }
sp-runtime = { workspace = true, features = ["std"] }
sp-timestamp = { workspace = true, features = ["std"] }
substrate-frame-rpc-system.workspace = true
substrate-prometheus-endpoint.workspace = true
frame-benchmarking = { workspace = true }
frame-benchmarking-cli = { workspace = true }
pallet-transaction-payment-rpc = { workspace = true }
sc-basic-authorship = { workspace = true }
sc-chain-spec = { workspace = true }
sc-cli = { workspace = true }
sc-client-api = { workspace = true }
sc-consensus = { workspace = true }
sc-executor = { workspace = true }
sc-network = { workspace = true }
sc-network-sync = { workspace = true }
sc-offchain = { workspace = true }
sc-rpc-api = { workspace = true }
sc-service = { workspace = true }
sc-sysinfo = { workspace = true }
sc-telemetry = { workspace = true }
sc-tracing = { workspace = true }
sc-transaction-pool = { workspace = true }
sc-transaction-pool-api = { workspace = true }
sp-api = { workspace = true, features = ["std"] }
sp-block-builder = { workspace = true, features = ["std"] }
sp-blockchain = { workspace = true }
sp-consensus-aura = { workspace = true, features = ["std"] }
sp-core = { workspace = true, features = ["std"] }
sp-keystore = { workspace = true, features = ["std"] }
sp-runtime = { workspace = true, features = ["std"] }
sp-timestamp = { workspace = true, features = ["std"] }
substrate-frame-rpc-system = { workspace = true }
substrate-prometheus-endpoint = { workspace = true }

# Polkadot
polkadot-cli.workspace = true
polkadot-cli = { workspace = true }
polkadot-primitives = { workspace = true, features = ["std"] }

# Cumulus
cumulus-client-cli.workspace = true
cumulus-client-consensus-aura.workspace = true
cumulus-client-consensus-common.workspace = true
cumulus-client-service.workspace = true
cumulus-primitives-core = { workspace = true, features = ["std"] }
cumulus-client-cli = { workspace = true }
cumulus-client-consensus-aura = { workspace = true }
cumulus-client-consensus-common = { workspace = true }
cumulus-client-service = { workspace = true }
cumulus-primitives-core = { workspace = true, features = ["std"] }
cumulus-primitives-parachain-inherent = { workspace = true, features = ["std"] }
cumulus-relay-chain-interface.workspace = true

[build-dependencies]
substrate-build-script-utils.workspace = true
cumulus-relay-chain-interface = { workspace = true }

[features]
default = []
runtime-benchmarks = [
"frame-benchmarking-cli/runtime-benchmarks",
"dip-consumer-runtime-template/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
]
Loading

0 comments on commit 193190d

Please sign in to comment.