Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ai/knowledge/INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ Use this file to choose the next context file to read. Do not load every context

Load only when the task explicitly targets that area.

- Rust workspace and dependencies: `.ai/knowledge/rust-workspace.md`
- Use when editing `Cargo.toml`, adding dependencies, or changing workspace configuration.
- CLI parser/export: `.ai/knowledge/crates/cli/AGENTS.md`
- Plugins: `.ai/knowledge/plugins/AGENTS.md`
18 changes: 18 additions & 0 deletions .ai/knowledge/rust-workspace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Rust Workspace Context

## Dependency Management

For crates in the main workspace under `crates/`, declare dependency versions and internal crate paths only in the root `Cargo.toml` under `[workspace.dependencies]`.

In crate-local `Cargo.toml` files, reference dependencies with `workspace = true` and keep them in the matching group:

```toml
[dependencies]
# Internal crates
stypes.workspace = true

# External crates
serde.workspace = true
```

Keep the root workspace dependency list grouped by internal crates, external dependencies, and development dependencies.
1 change: 1 addition & 0 deletions crates/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ tar.workspace = true
flate2.workspace = true

[dev-dependencies]
# External crates
tempfile.workspace = true

[lints]
Expand Down
1 change: 1 addition & 0 deletions crates/bufread/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ workspace = true
[dependencies]

[dev-dependencies]
# External crates
criterion.workspace = true
proptest.workspace = true
rand.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/core/indexer_base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ edition.workspace = true
workspace = true

[dependencies]
# External crates
log.workspace = true
serde = { workspace = true , features = ["derive"] }
thiserror.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/core/merging/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ edition.workspace = true
workspace = true

[dependencies]
# External crates
log.workspace = true
serde = { workspace = true , features = ["derive"] }
serde_json.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/core/parsers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ workspace = true
[dependencies]
# Internal crates
someip_tools.workspace = true
stypes.workspace = true

# External crates
byteorder.workspace = true
Expand All @@ -24,7 +25,7 @@ thiserror.workspace = true
rand.workspace = true
someip-messages.workspace = true
someip-payload.workspace = true
stypes.workspace = true

[dev-dependencies]
# External crates
stringreader.workspace = true
3 changes: 3 additions & 0 deletions crates/core/plugins_host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ wasmtime.workspace = true
wasmtime-wasi.workspace = true

[dev-dependencies]
# Internal crates
processor.workspace = true

# External crates
criterion = { workspace = true, features = ["async_tokio"] }

[[bench]]
Expand Down
3 changes: 3 additions & 0 deletions crates/core/processor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ thiserror.workspace = true
tokio-util.workspace = true

[dev-dependencies]
# Internal crates
plugins_host.workspace = true

# External crates
criterion = { workspace = true, features = ["async_tokio"] }
pretty_assertions.workspace = true
rand.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/core/session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ uuid = { workspace = true , features = ["serde", "v4"] }
walkdir.workspace = true

[dev-dependencies]
# External crates
lazy_static.workspace = true
tempfile.workspace = true
insta.workspace = true
1 change: 1 addition & 0 deletions crates/core/someip_tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition.workspace = true
workspace = true

[dependencies]
# External crates
nom.workspace = true
thiserror.workspace = true

Expand Down
2 changes: 2 additions & 0 deletions crates/core/sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ uuid = { workspace = true , features = ["serde", "v4"] }
socket2.workspace = true

[target.'cfg(windows)'.dependencies]
# Internal crates
shell_tools.workspace = true

[dev-dependencies]
# External crates
env_logger.workspace = true
1 change: 1 addition & 0 deletions crates/core/text_grep/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ thiserror.workspace = true
regex.workspace = true

[dev-dependencies]
# External crates
tempfile.workspace = true
2 changes: 2 additions & 0 deletions crates/dir_checksum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2024"
description = "A Library which provides methods to calculate the checksum of the files in a given path recursively considering `gitignore` rules"

[dependencies]
# External crates
blake3 = { workspace = true, features = ["rayon"] }
ignore.workspace = true
memmap2.workspace = true
Expand All @@ -14,6 +15,7 @@ thiserror.workspace = true
log.workspace = true

[dev-dependencies]
# External crates
tempdir.workspace = true
anyhow.workspace = true
pretty_assertions.workspace = true
1 change: 1 addition & 0 deletions crates/file_tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
# External crates
anyhow.workspace = true
2 changes: 2 additions & 0 deletions crates/plugins_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ version = "0.1.0"
edition = "2024"

[dependencies]
# External crates
log.workspace = true
wit-bindgen.workspace = true

[dev-dependencies]
# External crates
trybuild.workspace = true

[features]
Expand Down
1 change: 1 addition & 0 deletions crates/stypes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ edition.workspace = true
workspace = true

[dependencies]
# External crates
serde = { workspace = true, features = ["derive"] }
dlt-core = { workspace = true, features = ["fibex", "statistics", "serialization"] }
uuid = { workspace = true, features = ["serde", "v4"] }
Expand Down
17 changes: 17 additions & 0 deletions docs/contributing/development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ You can pass additional Cargo or application arguments after the recipe:
just run -r -- path/to/file
```

## Dependency Management

For crates in the main workspace under `crates/`, declare dependency versions and internal crate paths only in the root `Cargo.toml` under `[workspace.dependencies]`.

In crate-local `Cargo.toml` files, reference dependencies with `workspace = true` and keep them in the matching group:

```toml
[dependencies]
# Internal crates
stypes.workspace = true

# External crates
serde.workspace = true
```

Keep the root workspace dependency list grouped by internal crates, external dependencies, and development dependencies.

## Formatting and Checks

Check Rust formatting without changing files:
Expand Down
Loading