Test repository-wide Rust formatter discovery (#41925)

## What changed

- Exercise Rust source discovery through a mocked `git ls-files` call, including files outside `codex-rs`, paths containing spaces, and stale entries that no longer exist.
- Assert that the formatter invokes `rustfmt` from `codex-rs` with the repository configuration in both format and check modes.
- Keep the multiline argument-comment lint fixture stable under formatting and update affected Rust test files to the expected style.

GitOrigin-RevId: 0cfffde1bb91bf620d2118bed1efc68466c0cca6
This commit is contained in:
Adam Perry @ OpenAI
2026-08-31 22:47:53 +00:00
committed by copyberry
parent 64c9cde458
commit 9127f21890
6 changed files with 109 additions and 79 deletions
@@ -16,10 +16,10 @@ const DOCKER_CONTAINER_ENV_VAR: &str = "CODEX_TEST_REMOTE_ENV_CONTAINER_NAME";
#[tokio::main(flavor = "multi_thread", worker_threads = 2)]
async fn main() -> Result<()> {
let test_binary = PathBuf::from(
std::env::var_os(TEST_BINARY_ENV_VAR)
.with_context(|| format!("{TEST_BINARY_ENV_VAR} must be set by the Bazel test rule"))?,
);
let test_binary =
PathBuf::from(std::env::var_os(TEST_BINARY_ENV_VAR).with_context(|| {
format!("{TEST_BINARY_ENV_VAR} must be set by the Bazel test rule")
})?);
let forwarded_args = std::env::args_os().skip(1).collect::<Vec<_>>();
if is_terse_list_request(&forwarded_args) {
@@ -28,7 +28,10 @@ async fn main() -> Result<()> {
.status()
.await
.context("list integration tests")?;
anyhow::ensure!(status.success(), "listing integration tests exited with {status}");
anyhow::ensure!(
status.success(),
"listing integration tests exited with {status}"
);
return Ok(());
}