-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathclippy.toml
More file actions
35 lines (28 loc) · 1.65 KB
/
clippy.toml
File metadata and controls
35 lines (28 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Allow unwrap/expect/panic in test code — production code is restricted via workspace lints
allow-expect-in-tests = true
allow-panic-in-tests = true
allow-unwrap-in-tests = true
# Panic safety — force explicit error handling
disallowed-macros = [
{ path = "std::unimplemented", reason = "Use a proper error type or todo! only in stubs that must not reach production" },
{ path = "std::todo", reason = "Remove all todo! before merging to main" },
]
disallowed-methods = [
{ path = "tokio::task::spawn", reason = "Verify that it's okay for the gateway to shut down without waiting for this task" },
{ path = "std::process::exit", reason = "Verify that it's okay to shut down the entire process without our normal shutdown logic" },
{ path = "uuid::Uuid::new_v4", reason = "Use `Uuid::now_v7` for time-sortable UUIDs instead" },
]
# Cognitive complexity limit — keeps routing/scheduling logic reviewable
cognitive-complexity-threshold = 25
# Allow somewhat larger stack futures (default is 16384). Our builder chains
# (AppContext::from_config et al.) naturally accumulate 17–19 KB of combined
# state across their many `.await` points; forcing Box::pin on each would add
# heap allocations to the cold startup path and obscure the builder shape.
# Keep the ceiling low enough to still catch genuinely runaway futures.
future-size-threshold = 20480
# Type complexity — flag deeply nested generics common in async tower stacks
type-complexity-threshold = 250
# Enforce API discipline during refactors
avoid-breaking-exported-api = false
# Warn on paths with 4+ segments — encourages use statements over deep inline paths
absolute-paths-max-segments = 3