diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a523c9..005bcdc 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-manifmt cargo-manifmt@2.0.0 rustc --version cargo --version --verbose cargo clippy --version @@ -39,6 +42,7 @@ jobs: run: | cargo fmt -- --check cargo clippy -- -D warnings + cargo manifmt --check cargo: name: Build & Test diff --git a/Cargo.toml b/Cargo.toml index 3b3c623..ed9e53d 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"