2026-07-16 06:46:02 +01:00
# Clippy config for crates/codegen/**.
#
# NOTE: clippy uses the NEAREST clippy.toml (no merging), so this file must
# duplicate any settings from the repo-root //clippy.toml.
# TODO: remove after https://github.com/hyperium/tonic/issues/2253 fixed.
large-error-threshold = 256
2026-07-30 19:07:40 +00:00
# Ban raw canonicalize: on Windows it returns verbatim `\\?\C:\...` paths that
# break external tools, leak into prompts, and poison path-equality keys.
# `dunce::canonicalize` keeps the verbatim form for paths it cannot simplify
# (over 260 chars, device names), so containment checks there fail closed.
2026-07-16 06:46:02 +01:00
#
2026-07-30 19:07:40 +00:00
# Ban raw child-process spawning: an unenrolled child outlives the session that
# started it, while an enrolled one dies with its scope. Allow with a reason
# where a child is waited on or deliberately detached.
2026-07-16 06:46:02 +01:00
#
2026-07-30 19:07:40 +00:00
# Enforced by `cargo clippy` and `just lint-rs`. The Bazel lint aspect pins the
# repo-root config instead, so crates this file does not reach carry a
# crate-level allow.
2026-07-16 06:46:02 +01:00
disallowed-methods = [
{ path = "std::fs::canonicalize" , reason = "returns \\\\?\\ verbatim paths on Windows; use dunce::canonicalize" } ,
{ path = "std::path::Path::canonicalize" , reason = "returns \\\\?\\ verbatim paths on Windows; use dunce::canonicalize" } ,
{ path = "tokio::fs::canonicalize" , reason = "returns \\\\?\\ verbatim paths on Windows; use xai_grok_tools::util::fs helpers or spawn_blocking + dunce::canonicalize" } ,
2026-07-30 19:07:40 +00:00
{ path = "std::process::Command::spawn" , reason = "an unenrolled child outlives its session; use xai_tty_utils::ProcessScope::enroll" } ,
{ path = "tokio::process::Command::spawn" , reason = "an unenrolled child outlives its session; use xai_tty_utils::ProcessScope::enroll" } ,
2026-07-16 06:46:02 +01:00
]