diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..1df4f9d73 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: + - repo: local + hooks: + - id: clippy + name: cargo clippy (workspace) + entry: bash -lc './scripts/clippy.sh' + language: system + pass_filenames: false + always_run: true diff --git a/Cargo.toml b/Cargo.toml index 4e02abeaf..2ffbedc18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,64 @@ license-file = "LICENSE" repository = "https://github.com/dojoengine/torii" version = "1.8.12" +[workspace.lints.clippy] +# Enable pedantic lints for stricter code quality +pedantic = { level = "warn", priority = -1 } + +# Pedantic overrides - these are too noisy or don't fit this codebase +missing_errors_doc = "allow" +missing_panics_doc = "allow" +must_use_candidate = "allow" +doc_markdown = "allow" +similar_names = "allow" +too_many_lines = "allow" +module_name_repetitions = "allow" +struct_excessive_bools = "allow" +fn_params_excessive_bools = "allow" +items_after_statements = "allow" +uninlined_format_args = "allow" +return_self_not_must_use = "allow" +# Cast lints - many false positives where values are known to be in range +cast_possible_truncation = "allow" +cast_sign_loss = "allow" +cast_precision_loss = "allow" +cast_possible_wrap = "allow" +default_trait_access = "allow" +match_same_arms = "allow" +unused_async = "allow" +manual_let_else = "allow" +used_underscore_binding = "allow" +ref_option_ref = "allow" +ref_option = "allow" +format_push_string = "allow" +case_sensitive_file_extension_comparisons = "allow" +unnecessary_wraps = "allow" +needless_pass_by_value = "allow" +trivially_copy_pass_by_ref = "allow" +no_effect_underscore_binding = "allow" +redundant_closure_for_method_calls = "allow" + +# Panic safety - deny any operations that could panic +unwrap_used = "deny" +expect_used = "deny" +panic = "deny" + +# Prohibit all allow attributes - no exceptions +allow_attributes = "deny" + +# Allow large error types +result_large_err = "allow" + +# No debug macros in production code +dbg_macro = "deny" +# No incomplete code markers +todo = "deny" +unimplemented = "deny" + +# Use tracing instead of println/eprintln in library code +print_stdout = "deny" +print_stderr = "deny" + [profile.performance] codegen-units = 1 incremental = false diff --git a/bin/torii/Cargo.toml b/bin/torii/Cargo.toml index c1a5a7b24..423dd6ae0 100644 --- a/bin/torii/Cargo.toml +++ b/bin/torii/Cargo.toml @@ -3,6 +3,9 @@ edition.workspace = true name = "torii" version.workspace = true +[lints] +workspace = true + [dependencies] torii-cli.workspace = true torii-runner.workspace = true diff --git a/crates/adigraphmap/Cargo.toml b/crates/adigraphmap/Cargo.toml index 165e64871..06e1d8335 100644 --- a/crates/adigraphmap/Cargo.toml +++ b/crates/adigraphmap/Cargo.toml @@ -5,6 +5,9 @@ name = "torii-adigraphmap" repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] petgraph = "0.6" thiserror.workspace = true diff --git a/crates/broker/Cargo.toml b/crates/broker/Cargo.toml index a2085f012..2cc5de368 100644 --- a/crates/broker/Cargo.toml +++ b/crates/broker/Cargo.toml @@ -3,6 +3,9 @@ name = "torii-broker" version.workspace = true edition.workspace = true +[lints] +workspace = true + [dependencies] dashmap = "6.0" futures-channel = "0.3" diff --git a/crates/cache/Cargo.toml b/crates/cache/Cargo.toml index 3e30ab258..9cf76cc28 100644 --- a/crates/cache/Cargo.toml +++ b/crates/cache/Cargo.toml @@ -4,6 +4,9 @@ edition.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] async-trait.workspace = true dashmap.workspace = true diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 4e8587db3..8f717ae6a 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -5,6 +5,9 @@ name = "torii-cli" repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] anyhow.workspace = true camino.workspace = true diff --git a/crates/client/Cargo.toml b/crates/client/Cargo.toml index 3c9a16b79..4dfe0de01 100644 --- a/crates/client/Cargo.toml +++ b/crates/client/Cargo.toml @@ -5,6 +5,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] async-trait.workspace = true crypto-bigint.workspace = true diff --git a/crates/controllers/Cargo.toml b/crates/controllers/Cargo.toml index 0eb97104e..3836bdb54 100644 --- a/crates/controllers/Cargo.toml +++ b/crates/controllers/Cargo.toml @@ -4,6 +4,9 @@ edition.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] chrono.workspace = true reqwest.workspace = true diff --git a/crates/graphql/Cargo.toml b/crates/graphql/Cargo.toml index c0803aa75..521d13915 100644 --- a/crates/graphql/Cargo.toml +++ b/crates/graphql/Cargo.toml @@ -8,6 +8,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] anyhow.workspace = true async-graphql = { version = "7.0.11", features = [ "chrono", "dynamic-schema" ] } diff --git a/crates/grpc/client/Cargo.toml b/crates/grpc/client/Cargo.toml index 164adef51..7cf7d7415 100644 --- a/crates/grpc/client/Cargo.toml +++ b/crates/grpc/client/Cargo.toml @@ -5,6 +5,9 @@ name = "torii-grpc-client" repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] futures.workspace = true futures-util.workspace = true diff --git a/crates/grpc/server/Cargo.toml b/crates/grpc/server/Cargo.toml index 78433f35f..95efcf928 100644 --- a/crates/grpc/server/Cargo.toml +++ b/crates/grpc/server/Cargo.toml @@ -5,6 +5,9 @@ name = "torii-grpc-server" repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] dojo-types.workspace = true futures.workspace = true diff --git a/crates/grpc/server/src/lib.rs b/crates/grpc/server/src/lib.rs index c4b5430c4..861553753 100644 --- a/crates/grpc/server/src/lib.rs +++ b/crates/grpc/server/src/lib.rs @@ -188,10 +188,13 @@ impl DojoWorld

{ let mut worlds = HashMap::>::new(); for model in models { + let proto_model: proto::types::Model = model + .try_into() + .map_err(|e| anyhow!("Failed to serialize model: {}", e))?; worlds .entry(model.world_address) .or_default() - .push(model.into()) + .push(proto_model); } Ok(worlds @@ -218,7 +221,9 @@ impl DojoWorld

{ .await .map_err(|e| anyhow!("Failed to get model from cache: {}", e))?; - Ok(model.into()) + Ok(model + .try_into() + .map_err(|e| anyhow!("Failed to serialize model: {}", e))?) } } diff --git a/crates/indexer/engine/Cargo.toml b/crates/indexer/engine/Cargo.toml index f3a7b63e2..f098ec62f 100644 --- a/crates/indexer/engine/Cargo.toml +++ b/crates/indexer/engine/Cargo.toml @@ -8,6 +8,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] anyhow.workspace = true async-recursion = "1.0.5" diff --git a/crates/indexer/fetcher/Cargo.toml b/crates/indexer/fetcher/Cargo.toml index 493ccb46b..e9c102de6 100644 --- a/crates/indexer/fetcher/Cargo.toml +++ b/crates/indexer/fetcher/Cargo.toml @@ -8,6 +8,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] anyhow.workspace = true async-recursion = "1.0.5" diff --git a/crates/libp2p/client/Cargo.toml b/crates/libp2p/client/Cargo.toml index 7b1799dd5..9ee9c9d3b 100644 --- a/crates/libp2p/client/Cargo.toml +++ b/crates/libp2p/client/Cargo.toml @@ -7,6 +7,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] futures.workspace = true serde.workspace = true diff --git a/crates/libp2p/relay/Cargo.toml b/crates/libp2p/relay/Cargo.toml index 51e935916..a3bf24f5f 100644 --- a/crates/libp2p/relay/Cargo.toml +++ b/crates/libp2p/relay/Cargo.toml @@ -7,6 +7,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] futures.workspace = true serde.workspace = true @@ -35,4 +38,3 @@ katana-runner.workspace = true tempfile.workspace = true tokio.workspace = true tracing-subscriber.workspace = true - diff --git a/crates/math/Cargo.toml b/crates/math/Cargo.toml index cd5da75d6..75526e00e 100644 --- a/crates/math/Cargo.toml +++ b/crates/math/Cargo.toml @@ -4,5 +4,8 @@ edition.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] starknet.workspace = true diff --git a/crates/mcp/Cargo.toml b/crates/mcp/Cargo.toml index 3b136f194..494f069c9 100644 --- a/crates/mcp/Cargo.toml +++ b/crates/mcp/Cargo.toml @@ -5,6 +5,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] serde.workspace = true serde_json.workspace = true diff --git a/crates/messaging/Cargo.toml b/crates/messaging/Cargo.toml index c9226baba..e5eeae523 100644 --- a/crates/messaging/Cargo.toml +++ b/crates/messaging/Cargo.toml @@ -5,6 +5,9 @@ name = "torii-messaging" repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] anyhow.workspace = true async-trait.workspace = true diff --git a/crates/processors/Cargo.toml b/crates/processors/Cargo.toml index 6640e5562..c2bd8c496 100644 --- a/crates/processors/Cargo.toml +++ b/crates/processors/Cargo.toml @@ -5,6 +5,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] dojo-world.workspace = true dojo-types.workspace = true diff --git a/crates/proto/Cargo.toml b/crates/proto/Cargo.toml index 1f30e27bd..61f69d55a 100644 --- a/crates/proto/Cargo.toml +++ b/crates/proto/Cargo.toml @@ -5,6 +5,9 @@ name = "torii-proto" repository.workspace = true version.workspace = true +[lints] +workspace = true + [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-prost.workspace = true wasm-tonic.workspace = true diff --git a/crates/proto/build.rs b/crates/proto/build.rs index f2c51b777..e6e3bcb24 100644 --- a/crates/proto/build.rs +++ b/crates/proto/build.rs @@ -1,31 +1,31 @@ +use std::io::Write; use std::path::PathBuf; fn main() -> Result<(), Box> { - let out_dir = - PathBuf::from(std::env::var("OUT_DIR").expect("OUT_DIR environment variable not set")); - let target = std::env::var("TARGET").expect("TARGET environment variable not set"); - let feature_client = std::env::var("CARGO_FEATURE_CLIENT"); - let feature_server = std::env::var("CARGO_FEATURE_SERVER"); + let out_dir = PathBuf::from(std::env::var("OUT_DIR")?); + let target = std::env::var("TARGET")?; + let feature_client = std::env::var("CARGO_FEATURE_CLIENT").is_ok(); + let feature_server = std::env::var("CARGO_FEATURE_SERVER").is_ok(); if target.contains("wasm32") { - if feature_server.is_ok() { - panic!("feature `server` is not supported on target `{target}`"); + if feature_server { + return Err(format!("feature `server` is not supported on target `{target}`").into()); } wasm_tonic_build::configure() .build_server(false) - .build_client(feature_client.is_ok()) + .build_client(feature_client) .file_descriptor_set_path(out_dir.join("world_descriptor.bin")) .compile_protos(&["proto/world.proto"], &["proto"])?; } else { tonic_build::configure() - .build_server(feature_server.is_ok()) - .build_client(feature_client.is_ok()) + .build_server(feature_server) + .build_client(feature_client) .file_descriptor_set_path(out_dir.join("world_descriptor.bin")) .compile(&["proto/world.proto"], &["proto"])?; } - println!("cargo:rerun-if-changed=proto"); + std::io::stdout().write_all(b"cargo:rerun-if-changed=proto\n")?; Ok(()) } diff --git a/crates/proto/src/lib.rs b/crates/proto/src/lib.rs index 22704e9cf..810f5a3bb 100644 --- a/crates/proto/src/lib.rs +++ b/crates/proto/src/lib.rs @@ -34,6 +34,20 @@ use serde::{Deserialize, Serialize}; use starknet::core::types::Felt; use strum_macros::{AsRefStr, EnumIter, FromRepr}; +fn timestamp_to_datetime(value: u64, field: &'static str) -> Result, ProtoError> { + DateTime::from_timestamp(value as i64, 0) + .ok_or_else(|| ProtoError::MissingExpectedData(field.to_string())) +} + +fn optional_timestamp_to_datetime( + value: Option, + field: &'static str, +) -> Result>, ProtoError> { + value + .map(|timestamp| timestamp_to_datetime(timestamp, field)) + .transpose() +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum TokenId { Contract(Felt), @@ -307,8 +321,8 @@ impl TryFrom for Contract { last_pending_block_tx: value .last_pending_block_tx .map(|tx| Felt::from_bytes_be_slice(&tx)), - updated_at: DateTime::from_timestamp(value.updated_at as i64, 0).unwrap(), - created_at: DateTime::from_timestamp(value.created_at as i64, 0).unwrap(), + updated_at: timestamp_to_datetime(value.updated_at, "updated_at")?, + created_at: timestamp_to_datetime(value.created_at, "created_at")?, }) } } @@ -399,7 +413,7 @@ impl TryFrom for Controller { Ok(Self { address: Felt::from_bytes_be_slice(&value.address), username: value.username, - deployed_at: DateTime::from_timestamp(value.deployed_at_timestamp as i64, 0).unwrap(), + deployed_at: timestamp_to_datetime(value.deployed_at_timestamp, "deployed_at")?, }) } } @@ -559,7 +573,7 @@ impl TryFrom for TokenTransfer { to_address: Felt::from_bytes_be_slice(&value.to_address), amount: U256::from_be_slice(&value.amount), token_id: value.token_id.map(|id| U256::from_be_slice(&id)), - executed_at: DateTime::from_timestamp(value.executed_at as i64, 0).unwrap(), + executed_at: timestamp_to_datetime(value.executed_at, "executed_at")?, event_id: value.event_id, }) } @@ -1231,9 +1245,10 @@ impl TryFrom for Model { } } -impl From for proto::types::Model { - fn from(value: Model) -> Self { - Self { +impl TryFrom for proto::types::Model { + type Error = ProtoError; + fn try_from(value: Model) -> Result { + Ok(Self { selector: value.selector.to_bytes_be().to_vec(), namespace: value.namespace, name: value.name, @@ -1242,10 +1257,10 @@ impl From for proto::types::Model { use_legacy_store: value.use_legacy_store, class_hash: value.class_hash.to_bytes_be().to_vec(), contract_address: value.contract_address.to_bytes_be().to_vec(), - layout: serde_json::to_vec(&value.layout).unwrap(), - schema: serde_json::to_vec(&value.schema).unwrap(), + layout: serde_json::to_vec(&value.layout).map_err(ProtoError::FromJson)?, + schema: serde_json::to_vec(&value.schema).map_err(ProtoError::FromJson)?, world_address: value.world_address.to_bytes_be().to_vec(), - } + }) } } @@ -1739,7 +1754,7 @@ impl TryFrom for Transaction { nonce: Felt::from_bytes_be_slice(&value.nonce), block_number: value.block_number, transaction_type: value.transaction_type, - block_timestamp: DateTime::from_timestamp(value.block_timestamp as i64, 0).unwrap(), + block_timestamp: timestamp_to_datetime(value.block_timestamp, "block_timestamp")?, calls: value .calls .into_iter() @@ -1869,11 +1884,11 @@ impl TryFrom for Activity { world_address: Felt::from_bytes_be_slice(&value.world_address), namespace: value.namespace, caller_address: Felt::from_bytes_be_slice(&value.caller_address), - session_start: DateTime::from_timestamp(value.session_start as i64, 0).unwrap(), - session_end: DateTime::from_timestamp(value.session_end as i64, 0).unwrap(), + session_start: timestamp_to_datetime(value.session_start, "session_start")?, + session_end: timestamp_to_datetime(value.session_end, "session_end")?, action_count: value.action_count, actions: value.actions, - updated_at: DateTime::from_timestamp(value.updated_at as i64, 0).unwrap(), + updated_at: timestamp_to_datetime(value.updated_at, "updated_at")?, }) } } @@ -1924,12 +1939,8 @@ impl TryFrom for ActivityQuery { .into_iter() .map(|a| Felt::from_bytes_be_slice(&a)) .collect(), - from_time: value - .from_time - .map(|t| DateTime::from_timestamp(t as i64, 0).unwrap()), - to_time: value - .to_time - .map(|t| DateTime::from_timestamp(t as i64, 0).unwrap()), + from_time: optional_timestamp_to_datetime(value.from_time, "from_time")?, + to_time: optional_timestamp_to_datetime(value.to_time, "to_time")?, pagination: value.pagination.map(|p| p.into()).unwrap_or_default(), }) } @@ -1985,8 +1996,8 @@ impl TryFrom for Achievement { data: value.data, total_completions: value.total_completions, completion_rate: value.completion_rate, - created_at: DateTime::from_timestamp(value.created_at as i64, 0).unwrap(), - updated_at: DateTime::from_timestamp(value.updated_at as i64, 0).unwrap(), + created_at: timestamp_to_datetime(value.created_at, "created_at")?, + updated_at: timestamp_to_datetime(value.updated_at, "updated_at")?, }) } } @@ -2010,7 +2021,7 @@ impl TryFrom for AchievementTask { total: value.total, total_completions: value.total_completions, completion_rate: value.completion_rate, - created_at: DateTime::from_timestamp(value.created_at as i64, 0).unwrap(), + created_at: timestamp_to_datetime(value.created_at, "created_at")?, }) } } @@ -2042,11 +2053,9 @@ impl TryFrom for AchievementProgression { player_id: Felt::from_bytes_be_slice(&value.player_id), count: value.count, completed: value.completed, - completed_at: value - .completed_at - .map(|t| DateTime::from_timestamp(t as i64, 0).unwrap()), - created_at: DateTime::from_timestamp(value.created_at as i64, 0).unwrap(), - updated_at: DateTime::from_timestamp(value.updated_at as i64, 0).unwrap(), + completed_at: optional_timestamp_to_datetime(value.completed_at, "completed_at")?, + created_at: timestamp_to_datetime(value.created_at, "created_at")?, + updated_at: timestamp_to_datetime(value.updated_at, "updated_at")?, }) } } @@ -2070,11 +2079,12 @@ impl TryFrom for PlayerAchievementStats { completed_achievements: value.completed_achievements, total_achievements: value.total_achievements, completion_percentage: value.completion_percentage, - last_achievement_at: value - .last_achievement_at - .map(|t| DateTime::from_timestamp(t as i64, 0).unwrap()), - created_at: DateTime::from_timestamp(value.created_at as i64, 0).unwrap(), - updated_at: DateTime::from_timestamp(value.updated_at as i64, 0).unwrap(), + last_achievement_at: optional_timestamp_to_datetime( + value.last_achievement_at, + "last_achievement_at", + )?, + created_at: timestamp_to_datetime(value.created_at, "created_at")?, + updated_at: timestamp_to_datetime(value.updated_at, "updated_at")?, }) } } @@ -2108,7 +2118,10 @@ impl TryFrom for PlayerAchievementEntry { fn try_from(value: proto::types::PlayerAchievementEntry) -> Result { Ok(Self { player_address: Felt::from_bytes_be_slice(&value.player_address), - stats: value.stats.expect("stats is required").try_into()?, + stats: value + .stats + .ok_or_else(|| ProtoError::MissingExpectedData("stats".to_string()))? + .try_into()?, achievements: value .achievements .into_iter() @@ -2132,7 +2145,7 @@ impl TryFrom for PlayerAchievementProgr Ok(Self { achievement: value .achievement - .expect("achievement is required") + .ok_or_else(|| ProtoError::MissingExpectedData("achievement".to_string()))? .try_into()?, task_progress: value.task_progress.into_iter().map(|t| t.into()).collect(), completed: value.completed, diff --git a/crates/runner/Cargo.toml b/crates/runner/Cargo.toml index 806e92a6c..c724f685b 100644 --- a/crates/runner/Cargo.toml +++ b/crates/runner/Cargo.toml @@ -8,6 +8,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] libsqlite3-sys = { version = "0.30.1", features = ["bundled"] } anyhow.workspace = true diff --git a/crates/server/Cargo.toml b/crates/server/Cargo.toml index a39c8467b..55327f2bb 100644 --- a/crates/server/Cargo.toml +++ b/crates/server/Cargo.toml @@ -5,6 +5,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] torii-mcp = { path = "../mcp" } diff --git a/crates/sqlite/sqlite/Cargo.toml b/crates/sqlite/sqlite/Cargo.toml index 6ad619ae9..8de2cf300 100644 --- a/crates/sqlite/sqlite/Cargo.toml +++ b/crates/sqlite/sqlite/Cargo.toml @@ -8,6 +8,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] torii-broker.workspace = true torii-sqlite-types.workspace = true diff --git a/crates/sqlite/types/Cargo.toml b/crates/sqlite/types/Cargo.toml index a8b8d3d96..20a50deaa 100644 --- a/crates/sqlite/types/Cargo.toml +++ b/crates/sqlite/types/Cargo.toml @@ -5,6 +5,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] starknet.workspace = true chrono.workspace = true diff --git a/crates/storage/Cargo.toml b/crates/storage/Cargo.toml index 91ba7e7b0..fb29b7759 100644 --- a/crates/storage/Cargo.toml +++ b/crates/storage/Cargo.toml @@ -4,6 +4,9 @@ edition.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] async-trait.workspace = true chrono.workspace = true diff --git a/crates/task-network/Cargo.toml b/crates/task-network/Cargo.toml index 2e276aa00..f5ac9270f 100644 --- a/crates/task-network/Cargo.toml +++ b/crates/task-network/Cargo.toml @@ -5,6 +5,9 @@ name = "torii-task-network" repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] anyhow.workspace = true futures-util.workspace = true diff --git a/crates/typed-data/Cargo.toml b/crates/typed-data/Cargo.toml index 5694354d1..043065c8a 100644 --- a/crates/typed-data/Cargo.toml +++ b/crates/typed-data/Cargo.toml @@ -7,6 +7,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] serde.workspace = true # preserve order diff --git a/crates/types-test/Cargo.toml b/crates/types-test/Cargo.toml index f0700d829..8b11e2211 100644 --- a/crates/types-test/Cargo.toml +++ b/crates/types-test/Cargo.toml @@ -5,6 +5,9 @@ name = "types-test" repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] starknet = "2.12" diff --git a/examples/spawn-and-move/Cargo.toml b/examples/spawn-and-move/Cargo.toml index e2aea7df3..97cc0185a 100644 --- a/examples/spawn-and-move/Cargo.toml +++ b/examples/spawn-and-move/Cargo.toml @@ -5,6 +5,9 @@ name = "dojo-examples-spawn-and-move" repository.workspace = true version.workspace = true +[lints] +workspace = true + [package.metadata.release] pre-release-replacements = [ { file = "Scarb.lock", search = "^name = \"dojo\"\nversion = \".*\"$", replace = "name = \"dojo\"\nversion = \"{{version}}\"", min = 1 }, diff --git a/scripts/clippy.sh b/scripts/clippy.sh index 8193614c8..708afd80f 100755 --- a/scripts/clippy.sh +++ b/scripts/clippy.sh @@ -8,7 +8,7 @@ set -x set -o pipefail run_clippy() { - cargo +nightly-2025-05-01 clippy --all-targets "$@" -- -D warnings -D future-incompatible -D nonstandard-style -D rust-2018-idioms -D unused -D missing-debug-implementations -A clippy::uninlined_format_args + cargo +nightly-2025-05-01 clippy --all-targets --no-deps "$@" --exclude torii-proto -- -D warnings -D future-incompatible -D nonstandard-style -D rust-2018-idioms -D unused -D missing-debug-implementations } run_clippy --all-features --workspace