Repository navigation
Expand file tree
/
Copy pathclippy.toml
More file actions
21 lines (21 loc) · 3.27 KB
/
Copy pathclippy.toml
File metadata and controls
21 lines (21 loc) · 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# The disallowed-methods block below is duplicated verbatim in every clippy.toml in the
# workspace. clippy resolves clippy.toml to the NEAREST file and does not merge, so a
# crate-level file silently shadows the root fence unless it carries these entries too.
# Keep them in sync; the remaining keys in this file are crate-specific policy.
disallowed-methods = [
{ path = "std::env::current_dir", reason = "The library must not depend on the process working directory: a call executed by the Lore service runs in a process whose directory is unrelated to the caller's. Use lore_revision::util::path::make_absolute, which resolves against the working directory the call carries." },
{ path = "dashmap::DashMap::entry", reason = "This function internally takes a write lock and returns it in the entry handle. This can potentially block worker threads and cause deadlocks if used incorrectly. If you're sure it's ok add #[allow(clippy::disallowed_methods)] with a comment explaining why its safe" },
{ path = "tokio::spawn", reason = "Use lore_base::lore_spawn! so LORE_CONTEXT is propagated to the spawned task." },
{ path = "tokio::task::spawn", reason = "Use lore_base::lore_spawn! so LORE_CONTEXT is propagated to the spawned task." },
{ path = "tokio::task::spawn_blocking", reason = "Use lore_base::lore_spawn_blocking! (or lore_spawn_blocking_nocontext!) so LORE_CONTEXT is propagated and the work lands on the core blocking pool." },
{ path = "tokio::task::block_in_place", reason = "Hands this worker's core to a replacement thread taken from the blocking pool, so it spends the same small budget as spawn_blocking while reading as though it costs no thread. Once that budget is gone the replacement is queued instead of spawned, and the core it holds stops running tasks until a slot frees. Await an async form instead; where none exists, add #[allow(clippy::disallowed_methods)] with a comment on why the call cannot stall a core." },
{ path = "tokio::task::spawn_local", reason = "Use lore_base::lore_spawn! so LORE_CONTEXT is propagated to the spawned task." },
{ path = "tokio::runtime::Handle::spawn", reason = "Use lore_base::lore_spawn! so LORE_CONTEXT is propagated and the task runs on the shared lore runtime." },
{ path = "tokio::runtime::Handle::spawn_blocking", reason = "Use lore_base::lore_spawn_blocking! so LORE_CONTEXT is propagated and the work lands on the core blocking pool." },
{ path = "tokio::task::JoinSet::spawn", reason = "Use lore_base::lore_spawn!(joinset, future) so the task runs on the shared lore runtime with LORE_CONTEXT propagated." },
{ path = "tokio::task::JoinSet::spawn_on", reason = "Use lore_base::lore_spawn!(joinset, future) so LORE_CONTEXT is propagated." },
{ path = "tokio::task::JoinSet::spawn_blocking", reason = "Use lore_base::lore_spawn_blocking!(joinset, closure) so LORE_CONTEXT is propagated." },
{ path = "tokio::task::JoinSet::spawn_blocking_on", reason = "Use lore_base::lore_spawn_blocking!(joinset, closure) so LORE_CONTEXT is propagated." },
{ path = "tokio::task::JoinSet::spawn_local", reason = "Use lore_base::lore_spawn!(joinset, future) so LORE_CONTEXT is propagated." },
{ path = "tokio::task::JoinSet::spawn_local_on", reason = "Use lore_base::lore_spawn!(joinset, future) so LORE_CONTEXT is propagated." },
]