diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b0fe51bfb918..b501dcd9e1b7 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -318,18 +318,18 @@ jobs: run: | ln -sf toolchains/nightly/rust-toolchain.toml - uses: actions-rust-lang/setup-rust-toolchain@v1 - - name: Install cargo-sort + - name: Install taplo-sort run: | - RUSTFLAGS='' cargo install cargo-sort --git https://github.com/Twey/cargo-sort/ --tag linera + RUSTFLAGS='' cargo install taplo-cli --locked - name: Check if Cargo.toml files are sorted run: | - cargo sort --check --workspace --grouped + taplo fmt --check - name: Check if example Cargo.toml files are sorted run: | cd examples - cargo sort --check --workspace --grouped + taplo fmt --check cd agent - cargo sort --check + taplo fmt --check lint-check-for-outdated-readme: runs-on: ubuntu-latest diff --git a/.taplo.toml b/.taplo.toml new file mode 100644 index 000000000000..61b3c9338dfa --- /dev/null +++ b/.taplo.toml @@ -0,0 +1,11 @@ +include = ["Cargo.toml"] + +[formatting] +reorder_keys = false + +[[rule]] +include = ["Cargo.toml"] +keys = ["workspace.dependencies"] + +[rule.formatting] +reorder_keys = true \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index daa2ecc07c83..a38aa78ec63d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,32 +1,32 @@ [workspace] members = [ - "linera-base", - "linera-chain", - "linera-client", - "linera-core", - "linera-ethereum", - "linera-execution", - "linera-explorer", - "linera-faucet", - "linera-faucet/client", - "linera-faucet/server", - "linera-indexer/example", - "linera-indexer/graphql-client", - "linera-indexer/lib", - "linera-indexer/plugins", - "linera-rpc", - "linera-sdk", - "linera-sdk-derive", - "linera-service", - "linera-service-graphql-client", - "linera-storage", - "linera-storage-service", - "linera-summary", - "linera-views", - "linera-views-derive", - "linera-witty", - "linera-witty-macros", - "linera-witty/test-modules", + "linera-base", + "linera-chain", + "linera-client", + "linera-core", + "linera-ethereum", + "linera-execution", + "linera-explorer", + "linera-faucet", + "linera-faucet/client", + "linera-faucet/server", + "linera-indexer/example", + "linera-indexer/graphql-client", + "linera-indexer/lib", + "linera-indexer/plugins", + "linera-rpc", + "linera-sdk", + "linera-sdk-derive", + "linera-service", + "linera-service-graphql-client", + "linera-storage", + "linera-storage-service", + "linera-summary", + "linera-views", + "linera-views-derive", + "linera-witty", + "linera-witty-macros", + "linera-witty/test-modules", ] exclude = ["examples", "scripts"] resolver = "2" @@ -40,7 +40,12 @@ license = "Apache-2.0" edition = "2021" [workspace.dependencies] -heck = "0.4.1" +alloy = { version = "0.9.2", default-features = false } +alloy-primitives = { version = "0.8.18", default-features = false, features = [ + "serde", +] } +alloy-signer-local = "0.9.2" +alloy-sol-types = "0.8.18" anyhow = "1.0.80" assert_matches = "1.5.0" async-graphql = "=7.0.2" @@ -75,10 +80,10 @@ derive_more = "1.0.0" dirs = "5.0.1" dyn-clone = "1.0.17" ed25519-dalek = { version = "2.1.1", default-features = false, features = [ - "batch", - "fast", - "serde", - "zeroize", + "batch", + "fast", + "serde", + "zeroize", ] } either = "1.10.0" flarch = "0.7.0" @@ -91,60 +96,65 @@ genawaiter = "0.99.1" generic-array = { version = "0.14.7", features = ["serde"] } getrandom = "0.2.12" git2 = "0.19.0" +glob = "0.3.1" +gloo-utils = "0.2.0" +heck = "0.4.1" hex = "0.4.3" http = "1.1.0" humantime = "2.1.0" -glob = "0.3.1" -gloo-utils = "0.2.0" indexed_db_futures = "0.4.1" insta = "1.36.1" is-terminal = "0.4.12" -alloy-sol-types = "0.8.18" -alloy = { version = "0.9.2", default-features = false } -alloy-signer-local = "0.9.2" -alloy-primitives = { version = "0.8.18", default-features = false, features = ["serde"] } +js-sys = "0.3.70" +k8s-openapi = { version = "0.21.1", features = ["v1_28"] } +kube = "0.88.1" +linked-hash-map = "0.5.6" log = "0.4.21" lru = "0.12.3" -linked-hash-map = "0.5.6" num-bigint = "0.4.3" num-traits = "0.2.18" octocrab = "0.42.1" oneshot = "0.1.6" +pathdiff = "0.2.1" port-selector = "0.1.6" prettyplease = "0.2.16" -prometheus = "0.13.3" proc-macro-error = "1.0.4" proc-macro2 = "1.0" +prometheus = "0.13.3" proptest = { version = "1.6.0", default-features = false, features = ["alloc"] } prost = "0.13.2" quote = "1.0" rand = { version = "0.8.5", default-features = false } rand_chacha = { version = "0.3.1", default-features = false } rand_distr = { version = "0.4.3", default-features = false } -ruzstd = "0.7.1" -k8s-openapi = { version = "0.21.1", features = ["v1_28"] } -pathdiff = "0.2.1" -kube = "0.88.1" rcgen = "0.12.1" reqwest = { version = "0.11.24", default-features = false, features = [ - "rustls-tls", + "rustls-tls", ] } revm = "19.4.0" -revm-interpreter = { version = "15.1.0", features = [ "serde" ] } +revm-interpreter = { version = "15.1.0", features = ["serde"] } revm-precompile = "16.0.0" revm-primitives = "15.1.0" rocksdb = "0.21.0" -secp256k1 = { version = "0.30.0", default-features = false, features = [ "alloc", "rand", "serde" ] } +ruzstd = "0.7.1" scylla = "0.15.1" +secp256k1 = { version = "0.30.0", default-features = false, features = [ + "alloc", + "rand", + "serde", +] } semver = "1.0.22" serde = { version = "1.0.197", features = ["derive"] } -serde_bytes = "0.11.14" -serde_json = "1.0.114" -serde_yaml = "0.8.26" serde-name = "0.2.1" serde-reflection = "0.3.6" serde-wasm-bindgen = "0.6.5" -serde_with = { version = "3", default-features = false, features = ["alloc", "macros"] } +serde_bytes = "0.11.14" +serde_json = "1.0.114" +serde_with = { version = "3", default-features = false, features = [ + "alloc", + "macros", +] } +serde_yaml = "0.8.26" sha3 = "0.10.8" similar-asserts = "1.5.0" static_assertions = "1.1.0" @@ -153,27 +163,27 @@ syn = "2.0.52" tempfile = "3.10.1" test-case = "3.3.1" test-log = { version = "0.2.15", default-features = false, features = [ - "trace", + "trace", ] } test-strategy = "0.3.1" thiserror = "1.0.65" thiserror-context = "0.1.1" +tokio = "1.36.0" +tokio-stream = "0.1.14" +tokio-test = "0.4.3" +tokio-util = "0.7.10" +toml = "0.8.10" tonic = { version = "0.12.3", default-features = false } tonic-build = { version = "0.12.3", default-features = false } tonic-health = "0.12" tonic-reflection = "0.12" tonic-web = "0.12" tonic-web-wasm-client = "0.6.0" -tokio = "1.36.0" -tokio-stream = "0.1.14" -tokio-test = "0.4.3" -tokio-util = "0.7.10" -toml = "0.8.10" -tower-http = "0.5.2" tower = "0.4.13" +tower-http = "0.5.2" tracing = { version = "0.1.40", features = ["release_max_level_debug"] } tracing-subscriber = { version = "0.3.18", default-features = false, features = [ - "env-filter", + "env-filter", ] } tracing-web = "0.1.3" trait-variant = "0.1.1" @@ -186,19 +196,18 @@ wasm-instrument = "0.4.0" wasm_thread = "0.3.0" wasmer = { package = "linera-wasmer", version = "4.4.0-linera.6", default-features = false } wasmer-compiler-singlepass = { package = "linera-wasmer-compiler-singlepass", version = "4.4.0-linera.6", default-features = false, features = [ - "std", - "unwind", - "avx", + "std", + "unwind", + "avx", ] } wasmparser = "0.101.1" wasmtime = { version = "25.0.0", default-features = false, features = [ - "cranelift", - "runtime", - "std", + "cranelift", + "runtime", + "std", ] } wasmtimer = "0.2.0" web-sys = "0.3.69" -js-sys = "0.3.70" web-time = "1.1.0" wit-bindgen = "0.24.0" zstd = "0.13.2" @@ -217,6 +226,9 @@ linera-indexer-graphql-client = { version = "0.14.0", path = "./linera-indexer/g linera-indexer-plugins = { version = "0.14.0", path = "./linera-indexer/plugins" } linera-rpc = { version = "0.14.0", path = "./linera-rpc" } linera-sdk = { version = "0.14.0", path = "./linera-sdk" } +linera-sdk-derive = { version = "0.14.0", path = "./linera-sdk-derive" } +linera-service = { version = "0.14.0", path = "./linera-service", default-features = false } +linera-service-graphql-client = { version = "0.14.0", path = "./linera-service-graphql-client" } linera-storage = { version = "0.14.0", path = "./linera-storage", default-features = false } linera-storage-service = { version = "0.14.0", path = "./linera-storage-service", default-features = false } linera-version = { version = "0.14.0", path = "./linera-version" } @@ -224,20 +236,17 @@ linera-views = { version = "0.14.0", path = "./linera-views", default-features = linera-views-derive = { version = "0.14.0", path = "./linera-views-derive" } linera-witty = { version = "0.14.0", path = "./linera-witty" } linera-witty-macros = { version = "0.14.0", path = "./linera-witty-macros" } -linera-sdk-derive = { version = "0.14.0", path = "./linera-sdk-derive" } -linera-service = { version = "0.14.0", path = "./linera-service", default-features = false } -linera-service-graphql-client = { version = "0.14.0", path = "./linera-service-graphql-client" } +amm = { path = "./examples/amm" } counter = { path = "./examples/counter" } -meta-counter = { path = "./examples/meta-counter" } +crowd-funding = { path = "./examples/crowd-funding" } ethereum-tracker = { path = "./examples/ethereum-tracker" } fungible = { path = "./examples/fungible" } +matching-engine = { path = "./examples/matching-engine" } +meta-counter = { path = "./examples/meta-counter" } native-fungible = { path = "./examples/native-fungible" } non-fungible = { path = "./examples/non-fungible" } -crowd-funding = { path = "./examples/crowd-funding" } -matching-engine = { path = "./examples/matching-engine" } social = { path = "./examples/social" } -amm = { path = "./examples/amm" } [profile.release] lto = "thin" diff --git a/INSTALL.md b/INSTALL.md index 8ff60457be4d..0a4457c158ae 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -24,7 +24,7 @@ * `brew install jq` * `cargo install cargo-rdme` -* `cargo install cargo-sort` +* `cargo install taplo-cli` * `cargo install cargo-all-features` * `cargo install cargo-machete` @@ -51,7 +51,7 @@ Alternatively, we have added experimental Nix support (see `flake.nix`). * `sudo apt-get install jq` * `cargo install cargo-rdme` -* `cargo install cargo-sort` +* `cargo install taplo-cli` * `cargo install cargo-all-features` * `cargo install cargo-machete` diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 58ec1ff30726..4776f4fc39f8 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -1,23 +1,24 @@ [workspace] resolver = "2" members = [ - "amm", - "counter", - "crowd-funding", - "ethereum-tracker", - "fungible", - "gen-nft", - "hex-game", - "llm", - "matching-engine", - "meta-counter", - "native-fungible", - "non-fungible", - "rfq", - "social", + "amm", + "counter", + "crowd-funding", + "ethereum-tracker", + "fungible", + "gen-nft", + "hex-game", + "llm", + "matching-engine", + "meta-counter", + "native-fungible", + "non-fungible", + "rfq", + "social", ] [workspace.dependencies] +alloy = { version = "0.9.2", default-features = false } assert_matches = "1.5.0" async-graphql = { version = "=7.0.2", default-features = false } base64 = "0.22.0" @@ -26,9 +27,10 @@ candle-core = "0.4.1" candle-transformers = "0.4.1" futures = "0.3.24" futures-util = "0.3.26" -getrandom = { version = "0.2.12", default-features = false, features = ["custom"] } +getrandom = { version = "0.2.12", default-features = false, features = [ + "custom", +] } hex = "0.4.3" -alloy = { version = "0.9.2", default-features = false } linera-sdk = { path = "../linera-sdk" } linera-views = { path = "../linera-views", default-features = false } log = "0.4.20" @@ -38,18 +40,22 @@ rand = "0.8.5" serde = { version = "1.0.152", features = ["derive"] } serde_json = "1.0.93" sha3 = "0.10.8" -test-log = { version = "0.2.15", default-features = false, features = ["trace"] } -tokenizers = { git = "https://github.com/christos-h/tokenizers", default-features = false, features = ["unstable_wasm"] } +test-log = { version = "0.2.15", default-features = false, features = [ + "trace", +] } +tokenizers = { git = "https://github.com/christos-h/tokenizers", default-features = false, features = [ + "unstable_wasm", +] } tokio = { version = "1.25.0", features = ["macros", "rt-multi-thread"] } +amm = { path = "./amm" } counter = { path = "./counter" } crowd-funding = { path = "./crowd-funding" } ethereum-tracker = { path = "./ethereum-tracker", features = ["ethereum"] } fungible = { path = "./fungible" } +matching-engine = { path = "./matching-engine" } native-fungible = { path = "./native-fungible" } non-fungible = { path = "./non-fungible" } -amm = { path = "./amm" } -matching-engine = { path = "./matching-engine" } [profile.release] debug = true diff --git a/examples/agent/Cargo.toml b/examples/agent/Cargo.toml index fed6693ad50f..acb5871f1527 100644 --- a/examples/agent/Cargo.toml +++ b/examples/agent/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1.0.95" clap = { version = "4.5.26", features = ["derive"] } reqwest = { version = "0.11.24", default-features = false, features = [ - "rustls-tls", + "rustls-tls", ] } rig-core = "0.8.0" serde = { version = "1.0.152", features = ["derive"] }