@@ -32,3 +32,37 @@ codegen-units = 1
3232opt-level = 3
3333incremental = false
3434codegen-units = 1
35+
36+ [workspace .lints .clippy ]
37+ # === Code Quality: Prevent incomplete/placeholder code ===
38+ todo = " deny"
39+ unimplemented = " deny" # Uncomment if you want to be strict about this too
40+
41+ # === True Bugs: Compiler can prove these are wrong ===
42+ eq_op = " warn" # x == x, x != x, etc.
43+ modulo_one = " warn" # x % 1 (always returns 0)
44+ out_of_bounds_indexing = " warn" # Compiler-checked out of bounds access
45+
46+ # === Stack Management: Critical for Solana (32KB stack limit) ===
47+ large_stack_arrays = " warn"
48+ large_stack_frames = " warn"
49+
50+ # === Security Audit Support ===
51+ undocumented_unsafe_blocks = " warn" # Document why unsafe is needed
52+
53+ # === Potential Runtime Errors ===
54+ unchecked_duration_subtraction = " warn" # Can panic on underflow
55+ panicking_overflow_checks = " warn" # Overflow checks that panic in release
56+ if_let_mutex = " warn" # Can cause deadlocks
57+
58+ # === Performance: Catch accidental inefficiencies ===
59+ or_fun_call = " warn" # Use .unwrap_or_else instead of .unwrap_or
60+ set_contains_or_insert = " warn" # Use .entry() API instead
61+ stable_sort_primitive = " warn" # Unstable sort is faster for primitives
62+
63+ # === Logic Bugs ===
64+ suspicious_operation_groupings = " warn" # Likely copy-paste errors
65+
66+ # === Data Structure Misuse ===
67+ iter_over_hash_type = " warn" # Non-deterministic iteration order
68+ non_send_fields_in_send_ty = " warn" # Breaks thread safety
0 commit comments