Skip to content

Commit

Permalink
Chore: Forbid unused crates (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilevyor authored Mar 14, 2024
1 parent 95482a9 commit 4020a8f
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 26 deletions.
9 changes: 0 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions crates/auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "marzano-auth"
version = "0.1.0"
edition = "2021"

[lints]
rust.unused_crate_dependencies = "forbid"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
10 changes: 5 additions & 5 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ mod suppress;
mod text_unparser;
pub mod tree_sitter_serde;

#[cfg(test)]
mod test;

// getrandom is a deeply nested dependency used by many things eg. uuid
// to get wasm working we needed to enable a feature for this crate, so
// while we don't have a direct usage of it, we had to add it as a dependency
// and here we import it to avoid an unused dependency warning
#[cfg(target_arch = "wasm32")]
use getrandom as _;
#[cfg(feature = "wasm_core")]
use getrandom as _;

#[cfg(test)]
mod test;
4 changes: 3 additions & 1 deletion crates/externals/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name = "marzano-externals"
version = "0.1.0"
edition = "2021"

[lints]
rust.unused_crate_dependencies = "forbid"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0.70"
extism = "^1.0.0-rc7"
log = "0.4.19"
serde_json = "1.0.96"
3 changes: 3 additions & 0 deletions crates/gritcache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "grit_cache"
version = "0.1.0"
edition = "2021"

[lints]
rust.unused_crate_dependencies = "forbid"

[dependencies]
marzano-gritmodule = { path = "../gritmodule", features = [
], default-features = false }
Expand Down
5 changes: 3 additions & 2 deletions crates/gritmodule/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ name = "marzano-gritmodule"
version = "0.1.0"
edition = "2021"

[lints]
rust.unused_crate_dependencies = "forbid"

[dependencies]
marzano-core = { path = "../core", features = [], default-features = true }
marzano-language = { path = "../language" }
marzano-util = { path = "../util", features = ["finder"] }
tree-sitter-gritql = { path = "../../vendor/tree-sitter-gritql" }
tree-sitter = { path = "../../vendor/tree-sitter-facade", package = "tree-sitter-facade-sg" }
serde = { version = "1.0.164", features = ["derive"] }
serde_yaml = "0.9.25"
Expand All @@ -23,7 +25,6 @@ tokio = { version = "1", features = ["full"] }
tempfile = "3.7.0"
log = "0.4.19"
reqwest = { version = "0.11.22", features = ["blocking", "json"] }
sha2 = "0.10.8"
ignore = "0.4.20"
homedir = "0.2.1"

Expand Down
6 changes: 3 additions & 3 deletions crates/language/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "marzano-language"
version = "0.1.0"
edition = "2021"

[lints]
rust.unused_crate_dependencies = "forbid"

[dependencies]
tree-sitter = { path = "../../vendor/tree-sitter-facade", package = "tree-sitter-facade-sg" }
tree-sitter-gritql = { path = "../../vendor/tree-sitter-gritql", optional = true }
Expand All @@ -24,21 +27,18 @@ tree-sitter-ruby = { path = "../../resources/language-metavariables/tree-sitter-
tree-sitter-sql = { path = "../../resources/language-metavariables/tree-sitter-sql", optional = true }
tree-sitter-vue = { path = "../../resources/language-metavariables/tree-sitter-vue", optional = true }
tree-sitter-toml = { path = "../../resources/language-metavariables/tree-sitter-toml", optional = true }
serde = { version = "1.0.164", features = ["derive"] }
serde_json = { version = "1.0.91", features = ["preserve_order"] }
marzano-util = { path = "../util" }
regex = "1.7.1"
anyhow = "1.0.70"
itertools = "0.10.5"
lazy_static = "1.4.0"
either = "1.8.1"
ignore = { version = "0.4.21", optional = true }
web-sys = { version = "0.3.66", features = ["console"], optional = true }
tree-sitter-traversal = { version = "0.1.2", default-features = false }
enum_dispatch = "0.3.12"

[dev-dependencies]
insta = "1.26.0"
trim-margin = "0.1.0"

[features]
Expand Down
6 changes: 3 additions & 3 deletions crates/lsp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "marzano-lsp"
version = "0.1.0"
edition = "2021"

[lints]
rust.unused_crate_dependencies = "forbid"

[dependencies]
tower-lsp = "0.20.0"
tokio = { version = "1", features = ["full"] }
Expand All @@ -18,10 +21,7 @@ ai_builtins = { git = "https://github.com/getgrit/ai_builtins.git", optional = t
marzano-util = { path = "../util", features = ["finder"] }
anyhow = "1.0.70"
dashmap = "5.5.3"
lazy_static = "1.4.0"
uuid = { version = "1.1", features = ["v4", "serde"] }
rayon = "1.8.0"
reqwest = { version = "0.11.22", features = ["blocking", "json"] }
tracing = { version = "0.1.40", default-features = false, features = [] }
tracing-opentelemetry = { version = "0.22.0", optional = true, default-features = false, features = [] }

Expand Down
1 change: 0 additions & 1 deletion crates/lsp/src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::{
use dashmap::{DashMap, DashSet};

use grit_cache::cache::{cache_dir, Cache};
use rayon::prelude::{IntoParallelRefIterator, ParallelIterator};
use tokio::{runtime::Runtime, task::spawn_blocking};
use tower_lsp::{
lsp_types::{Diagnostic, MessageType, TextDocumentItem, Url},
Expand Down
3 changes: 3 additions & 0 deletions crates/marzano_messenger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "marzano_messenger"
version = "0.1.0"
edition = "2021"

[lints]
rust.unused_crate_dependencies = "forbid"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
3 changes: 3 additions & 0 deletions crates/test_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "marzano-test-utils"
version = "0.1.0"
edition = "2021"

[lints]
rust.unused_crate_dependencies = "forbid"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
7 changes: 5 additions & 2 deletions crates/util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "marzano-util"
version = "0.1.0"
edition = "2021"

[lints]
rust.unused_crate_dependencies = "forbid"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand All @@ -21,14 +24,14 @@ reqwest = { version = "0.11.22", features = [
], optional = true }
tokio = { version = "1.35.1", optional = true }
serde_json = "1.0.114"
futures = "0.3.29"
futures = { version = "0.3.29", optional = true}
http = "0.2.11"

[features]
finder = ["log", "ignore"]

network_requests_common = []
network_requests = ["reqwest", "tokio", "tokio/rt", "network_requests_common"]
network_requests = ["dep:futures", "reqwest", "tokio", "tokio/rt", "network_requests_common"]
network_requests_external = ["network_requests_common"]

external_functions_ffi = []

0 comments on commit 4020a8f

Please sign in to comment.