From 6d15cf4fd1221d651146c27b4cac4b675903d69a Mon Sep 17 00:00:00 2001 From: Evan Simmons Date: Wed, 29 Nov 2023 11:40:16 -0800 Subject: [PATCH 1/2] cargo sort --- .github/workflows/ci.yml | 4 +++ Cargo.toml | 56 ++++++++++++++++++++------------------ examples/Cargo.toml | 17 ++++++------ readme.md | 1 + trace4rs-config/Cargo.toml | 12 ++++---- trace4rs-fmtorp/Cargo.toml | 6 ++-- trace4rs/Cargo.toml | 19 +++++++------ 7 files changed, 63 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a523c9..8c080c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: streetsidesoftware/cspell-action@v5 + - uses: cargo-bins/cargo-binstall@main + - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} @@ -30,6 +32,7 @@ jobs: - name: Info run: | + cargo binstall -y --git https://github.com/estk/cargo-sort cargo-sort rustc --version cargo --version --verbose cargo clippy --version @@ -39,6 +42,7 @@ jobs: run: | cargo fmt -- --check cargo clippy -- -D warnings + cargo sort --check cargo: name: Build & Test diff --git a/Cargo.toml b/Cargo.toml index 3b3c623..b86e96d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ cargo-features = ["workspace-inheritance"] [workspace] resolver = "2" -members = ["trace4rs", "trace4rs-config", "trace4rs-fmtorp", "examples"] +members = [ "examples","trace4rs", "trace4rs-config", "trace4rs-fmtorp"] [workspace.package] version = "0.5.1" @@ -18,19 +18,19 @@ repository = "https://github.com/imperva/trace4rs" readme = "readme.md" categories = ["development-tools"] -[profile.dev] -opt-level = 1 -[profile.dev.package."*"] -opt-level = 3 - [workspace.dependencies] -literally = "0.1.3" -log = "0.4.14" -once_cell = "1.8.0" -parking_lot = "0.12.0" -regex = "1.5.4" -thiserror = "1.0.29" -tracing = "0.1.0" +trace4rs = { version = "*", path = "trace4rs" } +trace4rs-config = { version = "*", path = "trace4rs-config" } +trace4rs-fmtorp = { version = "*", path = "trace4rs-fmtorp" } + +time = { version = "0.3", features = ["formatting", "macros"] } +tokio = { version = "1.13.0", features = [ + "rt", + "rt-multi-thread", + "macros", + "time", + "fs", +] } tracing-subscriber = { version = "0.3", features = [ "std", "fmt", @@ -38,27 +38,24 @@ tracing-subscriber = { version = "0.3", features = [ "local-time", "registry", ] } -tracing-log = "0.2" -time = { version = "0.3", features = ["formatting", "macros"] } -path-absolutize = "3.0.11" -trace4rs = { version = "*", path = "trace4rs" } -trace4rs-config = { version = "*", path = "trace4rs-config" } -trace4rs-fmtorp = { version = "*", path = "trace4rs-fmtorp" } -utc-offset = "0.4.0" + camino = "1.1.2" criterion = "0.5.0" criterion-macro = "0.4.0" +literally = "0.1.3" +log = "0.4.14" log4rs = "1.0.0" +once_cell = "1.8.0" +parking_lot = "0.12.0" +path-absolutize = "3.0.11" +regex = "1.5.4" serde = "1.0.130" serde_json = "1.0.68" tempfile = "3.2.0" -tokio = { version = "1.13.0", features = [ - "rt", - "rt-multi-thread", - "macros", - "time", - "fs", -] } +thiserror = "1.0.29" +tracing = "0.1.0" +tracing-log = "0.2" +utc-offset = "0.4.0" [workspace.lints.clippy] all = "warn" @@ -101,6 +98,11 @@ unwrap_in_result = "warn" unwrap_used = "warn" verbose_file_reads = "warn" +[profile.dev] +opt-level = 1 +[profile.dev.package."*"] +opt-level = 3 + # Enable when stabilized # allow_attributes = "warn" # allow_attributes_without_reason = "warn" diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 99378ed..2877aef 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -5,16 +5,17 @@ publish = false edition = "2021" rust-version = "1.67" -[lints] -workspace = true - [dev-dependencies] +tracing-span-tree.git = "https://github.com/estk/tracing-span-tree" + +literally.workspace = true log.workspace = true -tracing-log.workspace = true tempfile.workspace = true -tracing-subscriber.workspace = true +tokio.workspace = true trace4rs.workspace = true -literally.workspace = true tracing.workspace = true -tokio.workspace = true -tracing-span-tree = { git = "https://github.com/estk/tracing-span-tree" } +tracing-log.workspace = true +tracing-subscriber.workspace = true + +[lints] +workspace = true diff --git a/readme.md b/readme.md index 5bcfe70..7be5c11 100644 --- a/readme.md +++ b/readme.md @@ -18,4 +18,5 @@ See for yourself with `cargo bench --features tracing-macros` ## Dev suggestions - `cargo install cargo-binstall` +- `cargo install cargo-update` - `cargo install cargo-nextest` diff --git a/trace4rs-config/Cargo.toml b/trace4rs-config/Cargo.toml index 0f23263..ca349a2 100644 --- a/trace4rs-config/Cargo.toml +++ b/trace4rs-config/Cargo.toml @@ -10,18 +10,20 @@ repository.workspace = true readme.workspace = true categories.workspace = true -[lints] -workspace = true - [features] in-order-serialization = ["serde"] [dependencies] +schemars = { version = "0.8.3", optional = true } + +serde = { workspace = true, optional = true, features = ["derive"] } + literally.workspace = true thiserror.workspace = true tracing.workspace = true -serde = { workspace = true, optional = true, features = ["derive"] } -schemars = { version = "0.8.3", optional = true } [dev-dependencies] serde_json.workspace = true + +[lints] +workspace = true diff --git a/trace4rs-fmtorp/Cargo.toml b/trace4rs-fmtorp/Cargo.toml index 2346d36..50b302a 100644 --- a/trace4rs-fmtorp/Cargo.toml +++ b/trace4rs-fmtorp/Cargo.toml @@ -10,12 +10,12 @@ repository.workspace = true readme.workspace = true categories.workspace = true -[lints] -workspace = true - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] [dependencies] thiserror.workspace = true tracing-subscriber.workspace = true + +[lints] +workspace = true diff --git a/trace4rs/Cargo.toml b/trace4rs/Cargo.toml index ce982c3..6827121 100644 --- a/trace4rs/Cargo.toml +++ b/trace4rs/Cargo.toml @@ -10,31 +10,30 @@ repository.workspace = true readme.workspace = true categories.workspace = true -[lints] -workspace = true - [features] tracing-macros = [] # internal, for benches serde = ["trace4rs-config/serde"] [dependencies] +camino.workspace = true literally.workspace = true log.workspace = true once_cell.workspace = true parking_lot.workspace = true +path-absolutize.workspace = true regex.workspace = true thiserror.workspace = true -tracing.workspace = true -tracing-subscriber.workspace = true -tracing-log.workspace = true time.workspace = true -path-absolutize.workspace = true trace4rs-config.workspace = true trace4rs-fmtorp.workspace = true +tracing.workspace = true +tracing-log.workspace = true +tracing-subscriber.workspace = true utc-offset.workspace = true -camino.workspace = true [dev-dependencies] +trace4rs-config = { workspace = true, features = ["in-order-serialization"] } + criterion.workspace = true criterion-macro.workspace = true log4rs.workspace = true @@ -42,7 +41,9 @@ serde.workspace = true serde_json.workspace = true tempfile.workspace = true tokio.workspace = true -trace4rs-config = { workspace = true, features = ["in-order-serialization"] } + +[lints] +workspace = true [[bench]] name = "trace4rs_bench" From 2ddb4668132086462e5affbb732cc15e799aff18 Mon Sep 17 00:00:00 2001 From: Evan Simmons Date: Wed, 29 Nov 2023 12:55:41 -0800 Subject: [PATCH 2/2] ci --- .github/workflows/ci.yml | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c080c2..005bcdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: - name: Info run: | - cargo binstall -y --git https://github.com/estk/cargo-sort cargo-sort + cargo binstall -y --git https://github.com/estk/cargo-manifmt cargo-manifmt@2.0.0 rustc --version cargo --version --verbose cargo clippy --version @@ -42,7 +42,7 @@ jobs: run: | cargo fmt -- --check cargo clippy -- -D warnings - cargo sort --check + cargo manifmt --check cargo: name: Build & Test diff --git a/Cargo.toml b/Cargo.toml index b86e96d..ed9e53d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ cargo-features = ["workspace-inheritance"] [workspace] resolver = "2" -members = [ "examples","trace4rs", "trace4rs-config", "trace4rs-fmtorp"] +members = ["examples", "trace4rs", "trace4rs-config", "trace4rs-fmtorp"] [workspace.package] version = "0.5.1"