Deny direct process spawn methods in Clippy

This commit is contained in:
Adam Perry
2026-05-21 14:52:18 -07:00
parent 4acb456bfe
commit a4abf76e8d
35 changed files with 47 additions and 0 deletions
+1
View File
@@ -491,6 +491,7 @@ async fn spawn_debug_sandbox_child(
cmd.env(CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR, "1");
}
#[allow(clippy::disallowed_methods, reason = "Grandfathered-in usage.")]
cmd.stdin(Stdio::inherit())
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
@@ -290,6 +290,7 @@ mod tests {
#[cfg(target_os = "macos")]
#[test]
fn list_child_pids_includes_spawned_child() {
#[allow(clippy::disallowed_methods, reason = "Grandfathered-in usage.")]
let mut child = Command::new("/bin/sleep")
.arg("5")
.stdin(Stdio::null())
@@ -319,6 +320,7 @@ mod tests {
async fn pid_tracker_collects_spawned_children() {
let tracker = PidTracker::new(std::process::id() as i32).expect("failed to create tracker");
#[allow(clippy::disallowed_methods, reason = "Grandfathered-in usage.")]
let mut child = Command::new("/bin/sleep")
.arg("0.1")
.stdin(Stdio::null())
@@ -347,6 +349,7 @@ mod tests {
async fn pid_tracker_collects_bash_subshell_descendants() {
let tracker = PidTracker::new(std::process::id() as i32).expect("failed to create tracker");
#[allow(clippy::disallowed_methods, reason = "Grandfathered-in usage.")]
let child = Command::new("/bin/bash")
.arg("-c")
.arg("(sleep 0.1 & echo $!; wait)")
@@ -89,6 +89,7 @@ fn start_log_stream() -> Option<Child> {
const PREDICATE: &str = r#"(((processID == 0) AND (senderImagePath CONTAINS "/Sandbox")) OR (subsystem == "com.apple.sandbox.reporting"))"#;
#[allow(clippy::disallowed_methods, reason = "Grandfathered-in usage.")]
tokio::process::Command::new("log")
.args(["stream", "--style", "ndjson", "--predicate", PREDICATE])
.stdin(Stdio::null())