Skip to content

Commit 3d9a1df

Browse files
committed
chore: enforce workspace clippy lints
1 parent 04f21bc commit 3d9a1df

File tree

31 files changed

+152
-2
lines changed

31 files changed

+152
-2
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: clippy
5+
name: cargo clippy (workspace)
6+
entry: bash -lc './scripts/clippy.sh'
7+
language: system
8+
pass_filenames: false
9+
always_run: true

Cargo.toml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,64 @@ license-file = "LICENSE"
2323
repository = "https://github.com/dojoengine/torii"
2424
version = "1.8.11"
2525

26+
[workspace.lints.clippy]
27+
# Enable pedantic lints for stricter code quality
28+
pedantic = { level = "warn", priority = -1 }
29+
30+
# Pedantic overrides - these are too noisy or don't fit this codebase
31+
missing_errors_doc = "allow"
32+
missing_panics_doc = "allow"
33+
must_use_candidate = "allow"
34+
doc_markdown = "allow"
35+
similar_names = "allow"
36+
too_many_lines = "allow"
37+
module_name_repetitions = "allow"
38+
struct_excessive_bools = "allow"
39+
fn_params_excessive_bools = "allow"
40+
items_after_statements = "allow"
41+
uninlined_format_args = "allow"
42+
return_self_not_must_use = "allow"
43+
# Cast lints - many false positives where values are known to be in range
44+
cast_possible_truncation = "allow"
45+
cast_sign_loss = "allow"
46+
cast_precision_loss = "allow"
47+
cast_possible_wrap = "allow"
48+
default_trait_access = "allow"
49+
match_same_arms = "allow"
50+
unused_async = "allow"
51+
manual_let_else = "allow"
52+
used_underscore_binding = "allow"
53+
ref_option_ref = "allow"
54+
ref_option = "allow"
55+
format_push_string = "allow"
56+
case_sensitive_file_extension_comparisons = "allow"
57+
unnecessary_wraps = "allow"
58+
needless_pass_by_value = "allow"
59+
trivially_copy_pass_by_ref = "allow"
60+
no_effect_underscore_binding = "allow"
61+
redundant_closure_for_method_calls = "allow"
62+
63+
# Panic safety - deny any operations that could panic
64+
unwrap_used = "deny"
65+
expect_used = "deny"
66+
panic = "deny"
67+
68+
# Prohibit all allow attributes - no exceptions
69+
allow_attributes = "deny"
70+
71+
# Allow large error types
72+
result_large_err = "allow"
73+
74+
# No debug macros in production code
75+
dbg_macro = "deny"
76+
# No incomplete code markers
77+
todo = "deny"
78+
unimplemented = "deny"
79+
80+
# Use tracing instead of println/eprintln in library code
81+
print_stdout = "deny"
82+
print_stderr = "deny"
83+
2684
[profile.performance]
2785
codegen-units = 1
2886
incremental = false

bin/torii/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ edition.workspace = true
33
name = "torii"
44
version.workspace = true
55

6+
[lints]
7+
workspace = true
8+
69
[dependencies]
710
torii-cli.workspace = true
811
torii-runner.workspace = true

crates/adigraphmap/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name = "torii-adigraphmap"
55
repository.workspace = true
66
version.workspace = true
77

8+
[lints]
9+
workspace = true
10+
811
[dependencies]
912
petgraph = "0.6"
1013
thiserror.workspace = true

crates/broker/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name = "torii-broker"
33
version.workspace = true
44
edition.workspace = true
55

6+
[lints]
7+
workspace = true
8+
69
[dependencies]
710
dashmap = "6.0"
811
futures-channel = "0.3"

crates/cache/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ edition.workspace = true
44
repository.workspace = true
55
version.workspace = true
66

7+
[lints]
8+
workspace = true
9+
710
[dependencies]
811
async-trait.workspace = true
912
dashmap.workspace = true

crates/cli/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name = "torii-cli"
55
repository.workspace = true
66
version.workspace = true
77

8+
[lints]
9+
workspace = true
10+
811
[dependencies]
912
anyhow.workspace = true
1013
camino.workspace = true

crates/client/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ version.workspace = true
55

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

8+
[lints]
9+
workspace = true
10+
811
[dependencies]
912
async-trait.workspace = true
1013
crypto-bigint.workspace = true

crates/controllers/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ edition.workspace = true
44
repository.workspace = true
55
version.workspace = true
66

7+
[lints]
8+
workspace = true
9+
710
[dependencies]
811
chrono.workspace = true
912
reqwest.workspace = true

crates/graphql/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ version.workspace = true
88

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

11+
[lints]
12+
workspace = true
13+
1114
[dependencies]
1215
anyhow.workspace = true
1316
async-graphql = { version = "7.0.11", features = [ "chrono", "dynamic-schema" ] }

0 commit comments

Comments
 (0)