diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b119cc93..8ef750e52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,7 +110,7 @@ jobs: - uses: taiki-e/install-action@v2 with: - tool: just,fd-find,cargo-machete,cargo-udeps,cargo-sort + tool: just,fd-find,cargo-machete,cargo-udeps,cargo-sort@2.1.0 - name: restore build & cargo cache uses: Swatinem/rust-cache@v2 diff --git a/Cargo.toml b/Cargo.toml index 4f69078ac..2f4ebb878 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,36 +30,36 @@ edition = "2024" anyhow = { version = "1.0.42", features = ["backtrace"] } askama = "0.15.4" async-stream = "0.3.5" -axum-extra = { version = "0.12.0", features = ["typed-header", "routing", "middleware"] } +axum-extra = { version = "0.12.0", features = ["middleware", "routing", "typed-header"] } base64 = "0.22" bon = { version = "3.8.1", features = ["experimental-overwritable"] } chrono = { version = "0.4.11", default-features = false, features = ["clock", "serde"] } -clap = { version = "4.0.22", features = [ "derive" ] } +clap = { version = "4.0.22", features = ["derive"] } futures-util = "0.3.5" http = "1.0.0" itertools = "0.14.0" mime = "0.3.16" mockito = "1.0.2" opentelemetry = "0.31.0" -opentelemetry-otlp = { version = "0.31.0", features = ["grpc-tonic", "metrics"] } +opentelemetry-otlp = { version = "0.31.0", features = ["grpc-tonic", "metrics"] } opentelemetry-resource-detectors = "0.10.0" opentelemetry_sdk = { version = "0.31.0", features = ["rt-tokio"] } postcard = { version = "1.1.3", default-features = false, features = ["use-std"] } pretty_assertions = "1.4.0" rand = "0.10" regex = "1" -reqwest = { version = "0.13", features = ["json", "gzip", "stream"] } -sentry = { version = "0.46.0", features = ["panic", "tracing", "tower-http", "backtrace"] } +reqwest = { version = "0.13", features = ["gzip", "json", "stream"] } +sentry = { version = "0.46.0", features = ["backtrace", "panic", "tower-http", "tracing"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_with = "3.4.0" slug = "0.1.1" -sqlx = { version = "0.8", features = [ "runtime-tokio", "postgres", "sqlite", "chrono" ] } +sqlx = { version = "0.8", features = ["chrono", "postgres", "runtime-tokio", "sqlite"] } strum = { version = "0.28.0", features = ["derive"] } tempfile = "3.1.0" test-case = "3.0.0" thiserror = "2.0.3" -tokio = { version = "1.0", features = ["rt-multi-thread", "signal", "macros", "process", "sync"] } +tokio = { version = "1.0", features = ["macros", "process", "rt-multi-thread", "signal", "sync"] } toml = "1.0.0" tracing = "0.1.37" url = { version = "2.1.1", features = ["serde"] } diff --git a/crates/bin/docs_rs_builder/Cargo.toml b/crates/bin/docs_rs_builder/Cargo.toml index d50fbeac4..0487652d3 100644 --- a/crates/bin/docs_rs_builder/Cargo.toml +++ b/crates/bin/docs_rs_builder/Cargo.toml @@ -29,7 +29,7 @@ docsrs-metadata = { path = "../../lib/metadata" } log = "0.4" opentelemetry = { workspace = true } regex = { workspace = true } -rustwide = { version = "0.22.0", features = ["unstable-toolchain-ci", "unstable"] } +rustwide = { version = "0.22.0", features = ["unstable", "unstable-toolchain-ci"] } serde_json = { workspace = true } sqlx = { workspace = true } sysinfo = { version = "0.38.0", default-features = false, features = ["system"] } diff --git a/crates/bin/docs_rs_watcher/Cargo.toml b/crates/bin/docs_rs_watcher/Cargo.toml index 5185d2a7a..07164ba9b 100644 --- a/crates/bin/docs_rs_watcher/Cargo.toml +++ b/crates/bin/docs_rs_watcher/Cargo.toml @@ -12,7 +12,7 @@ clap = { workspace = true } # NOTE: on the new infra, switch back from `git-https-reqwest` to `git-https` (curl) once the curl version is new enough crates-index = { version = "3.0.0", default-features = false, features = ["git", "git-https-reqwest", "git-performance", "parallel"] } # NOTE: on the new infra, switch back from `http-reqwest` to `http-curl` once the curl version is new enough -crates-index-diff = { version = "29.0.0", default-features = false, features = [ "max-performance", "semver", "http-reqwest" ] } +crates-index-diff = { version = "29.0.0", default-features = false, features = ["http-reqwest", "max-performance", "semver"] } docs_rs_build_queue = { path = "../../lib/docs_rs_build_queue" } docs_rs_config = { path = "../../lib/docs_rs_config" } docs_rs_context = { path = "../../lib/docs_rs_context" } diff --git a/crates/bin/docs_rs_web/Cargo.toml b/crates/bin/docs_rs_web/Cargo.toml index a32819026..f6b283c5d 100644 --- a/crates/bin/docs_rs_web/Cargo.toml +++ b/crates/bin/docs_rs_web/Cargo.toml @@ -59,22 +59,22 @@ serde = { workspace = true } serde_json = { workspace = true } slug = { workspace = true } sqlx = { workspace = true } -syntect = { version = "5.0.0", default-features = false, features = ["parsing", "html", "dump-load", "regex-onig"] } +syntect = { version = "5.0.0", default-features = false, features = ["dump-load", "html", "parsing", "regex-onig"] } thiserror = { workspace = true } tokio = { workspace = true } tokio-util = { version = "0.7.15", default-features = false, features = ["io"] } toml = { workspace = true } tower = "0.5.1" -tower-http = { version = "0.6.0", features = ["fs", "trace", "timeout", "catch-panic"] } +tower-http = { version = "0.6.0", features = ["catch-panic", "fs", "timeout", "trace"] } tracing = { workspace = true } -tracing-futures = { version = "0.2.5", features = ["std-future", "futures-03"] } +tracing-futures = { version = "0.2.5", features = ["futures-03", "std-future"] } url = { workspace = true } [build-dependencies] anyhow = { version = "1.0.42", features = ["backtrace"] } grass = { version = "0.13.1", default-features = false } md5 = "0.8.0" -syntect = { version = "5.0.0", default-features = false, features = ["parsing", "dump-create", "yaml-load", "regex-onig"] } +syntect = { version = "5.0.0", default-features = false, features = ["dump-create", "parsing", "regex-onig", "yaml-load"] } walkdir = { workspace = true } [dev-dependencies] diff --git a/crates/lib/docs_rs_logging/Cargo.toml b/crates/lib/docs_rs_logging/Cargo.toml index 09548470f..1a451f543 100644 --- a/crates/lib/docs_rs_logging/Cargo.toml +++ b/crates/lib/docs_rs_logging/Cargo.toml @@ -14,7 +14,7 @@ docs_rs_env_vars = { path = "../docs_rs_env_vars" } docs_rs_utils = { path = "../docs_rs_utils" } sentry = { workspace = true } tracing = { workspace = true } -tracing-subscriber = { version = "0.3.20", default-features = false, features = ["ansi", "fmt", "json", "env-filter", "tracing-log"] } +tracing-subscriber = { version = "0.3.20", default-features = false, features = ["ansi", "env-filter", "fmt", "json", "tracing-log"] } [dev-dependencies] docs_rs_config = { path = "../docs_rs_config", features = ["testing"] } diff --git a/crates/lib/docs_rs_opentelemetry/Cargo.toml b/crates/lib/docs_rs_opentelemetry/Cargo.toml index 539bda7d1..5476bffe7 100644 --- a/crates/lib/docs_rs_opentelemetry/Cargo.toml +++ b/crates/lib/docs_rs_opentelemetry/Cargo.toml @@ -13,7 +13,7 @@ anyhow = { workspace = true } docs_rs_config = { path = "../docs_rs_config" } docs_rs_env_vars = { path = "../docs_rs_env_vars" } opentelemetry = { workspace = true } -opentelemetry-otlp = { version = "0.31.0", features = ["grpc-tonic", "metrics"] } +opentelemetry-otlp = { version = "0.31.0", features = ["grpc-tonic", "metrics"] } opentelemetry-resource-detectors = "0.10.0" opentelemetry_sdk = { workspace = true } tracing = { workspace = true } diff --git a/crates/lib/docs_rs_storage/Cargo.toml b/crates/lib/docs_rs_storage/Cargo.toml index 4c8c62f61..140395d72 100644 --- a/crates/lib/docs_rs_storage/Cargo.toml +++ b/crates/lib/docs_rs_storage/Cargo.toml @@ -15,9 +15,9 @@ testing = [ [dependencies] anyhow = { workspace = true } -async-compression = { version = "0.4.32", features = ["tokio", "bzip2", "zstd", "gzip"] } +async-compression = { version = "0.4.32", features = ["bzip2", "gzip", "tokio", "zstd"] } async-stream = { workspace = true } -aws-config = { version = "1.0.0", default-features = false, features = ["rt-tokio", "default-https-client"] } +aws-config = { version = "1.0.0", default-features = false, features = ["default-https-client", "rt-tokio"] } aws-sdk-s3 = "1.3.0" aws-smithy-types-convert = { version = "0.60.0", features = ["convert-chrono"] } bzip2 = "0.6.0" diff --git a/justfiles/testing.just b/justfiles/testing.just index 4b3d3b5e6..5f1b7548e 100644 --- a/justfiles/testing.just +++ b/justfiles/testing.just @@ -96,12 +96,15 @@ lint: format lint-dependencies-machete [group('testing')] sort-cargo-toml *args: - # for now manually, `cargo sort --workspace` is broken right now for docs.rs - # https://github.com/DevinR528/cargo-sort/pull/121 - cargo sort {{ args }} \ - ./Cargo.toml \ - ./crates/bin/* \ - ./crates/lib/* + #!/usr/bin/env bash + set -euo pipefail + + if [ {{semver_matches(trim_start_match(shell("cargo-sort --version"), "cargo-sort "), ">=2.1.0")}} != 'true' ]; then + echo "cargo-sort to old, must be >=2.1.0" + exit 1; + fi + + cargo sort --workspace {{ args }} [group('testing')] diff --git a/tomlfmt.toml b/tomlfmt.toml new file mode 100644 index 000000000..9f0e71371 --- /dev/null +++ b/tomlfmt.toml @@ -0,0 +1 @@ +sort_feature_list = true