mirror of
https://github.com/openai/codex.git
synced 2026-05-01 03:42:05 +03:00
Apply argument comment lint across codex-rs (#14652)
## Why Once the repo-local lint exists, `codex-rs` needs to follow the checked-in convention and CI needs to keep it from drifting. This commit applies the fallback `/*param*/` style consistently across existing positional literal call sites without changing those APIs. The longer-term preference is still to avoid APIs that require comments by choosing clearer parameter types and call shapes. This PR is intentionally the mechanical follow-through for the places where the existing signatures stay in place. After rebasing onto newer `main`, the rollout also had to cover newly introduced `tui_app_server` call sites. That made it clear the first cut of the CI job was too expensive for the common path: it was spending almost as much time installing `cargo-dylint` and re-testing the lint crate as a representative test job spends running product tests. The CI update keeps the full workspace enforcement but trims that extra overhead from ordinary `codex-rs` PRs. ## What changed - keep a dedicated `argument_comment_lint` job in `rust-ci` - mechanically annotate remaining opaque positional literals across `codex-rs` with exact `/*param*/` comments, including the rebased `tui_app_server` call sites that now fall under the lint - keep the checked-in style aligned with the lint policy by using `/*param*/` and leaving string and char literals uncommented - cache `cargo-dylint`, `dylint-link`, and the relevant Cargo registry/git metadata in the lint job - split changed-path detection so the lint crate's own `cargo test` step runs only when `tools/argument-comment-lint/*` or `rust-ci.yml` changes - continue to run the repo wrapper over the `codex-rs` workspace, so product-code enforcement is unchanged Most of the code changes in this commit are intentionally mechanical comment rewrites or insertions driven by the lint itself. ## Verification - `./tools/argument-comment-lint/run.sh --workspace` - `cargo test -p codex-tui-app-server -p codex-tui` - parsed `.github/workflows/rust-ci.yml` locally with PyYAML --- * -> #14652 * #14651
This commit is contained in:
@@ -171,7 +171,7 @@ async fn run_exec_command(args: crate::cli::ExecCommand) -> anyhow::Result<()> {
|
||||
&env_id,
|
||||
&prompt,
|
||||
&git_ref,
|
||||
false,
|
||||
/*qa_mode*/ false,
|
||||
attempts,
|
||||
)
|
||||
.await?;
|
||||
@@ -827,7 +827,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
let backend = Arc::clone(&backend);
|
||||
let tx = tx.clone();
|
||||
tokio::spawn(async move {
|
||||
let res = app::load_tasks(&*backend, None).await;
|
||||
let res = app::load_tasks(&*backend, /*env*/ None).await;
|
||||
let _ = tx.send(app::AppEvent::TasksLoaded {
|
||||
env: None,
|
||||
result: res,
|
||||
@@ -861,7 +861,10 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
let headers = util::build_chatgpt_headers().await;
|
||||
|
||||
// Run autodetect. If it fails, we keep using "All".
|
||||
let res = crate::env_detect::autodetect_environment_id(&base_url, &headers, None).await;
|
||||
let res = crate::env_detect::autodetect_environment_id(
|
||||
&base_url, &headers, /*desired_label*/ None,
|
||||
)
|
||||
.await;
|
||||
let _ = tx.send(app::AppEvent::EnvironmentAutodetected(res));
|
||||
});
|
||||
}
|
||||
@@ -1105,7 +1108,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
ov.base_can_apply = true;
|
||||
ov.apply_selection_to_fields();
|
||||
} else {
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, None);
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, /*attempt_total_hint*/ None);
|
||||
{
|
||||
let base = overlay.base_attempt_mut();
|
||||
base.diff_lines = diff_lines.clone();
|
||||
@@ -1178,7 +1181,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
});
|
||||
}
|
||||
} else {
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, None);
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, /*attempt_total_hint*/ None);
|
||||
{
|
||||
let base = overlay.base_attempt_mut();
|
||||
base.text_lines = conv.clone();
|
||||
@@ -1216,7 +1219,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
.as_ref()
|
||||
.map(|d| d.lines().map(str::to_string).collect())
|
||||
.unwrap_or_default();
|
||||
let text_lines = conversation_lines(None, &attempt.messages);
|
||||
let text_lines = conversation_lines(/*prompt*/ None, &attempt.messages);
|
||||
ov.attempts.push(app::AttemptView {
|
||||
turn_id: Some(attempt.turn_id.clone()),
|
||||
status: attempt.status,
|
||||
@@ -1263,7 +1266,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
ov.current_view = app::DetailView::Prompt;
|
||||
ov.apply_selection_to_fields();
|
||||
} else {
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, None);
|
||||
let mut overlay = app::DiffOverlay::new(id.clone(), title, /*attempt_total_hint*/ None);
|
||||
{
|
||||
let base = overlay.base_attempt_mut();
|
||||
base.text_lines = pretty;
|
||||
@@ -1500,9 +1503,9 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
let backend = Arc::clone(&backend);
|
||||
let best_of_n = page.best_of_n;
|
||||
tokio::spawn(async move {
|
||||
let git_ref = resolve_git_ref(None).await;
|
||||
let git_ref = resolve_git_ref(/*branch_override*/ None).await;
|
||||
|
||||
let result = codex_cloud_tasks_client::CloudBackend::create_task(&*backend, &env, &text, &git_ref, false, best_of_n).await;
|
||||
let result = codex_cloud_tasks_client::CloudBackend::create_task(&*backend, &env, &text, &git_ref, /*qa_mode*/ false, best_of_n).await;
|
||||
let evt = match result {
|
||||
Ok(ok) => app::AppEvent::NewTaskSubmitted(Ok(ok)),
|
||||
Err(e) => app::AppEvent::NewTaskSubmitted(Err(format!("{e}"))),
|
||||
@@ -1685,11 +1688,11 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
needs_redraw = true;
|
||||
}
|
||||
KeyCode::Down | KeyCode::Char('j') => {
|
||||
if let Some(ov) = &mut app.diff_overlay { ov.sd.scroll_by(1); }
|
||||
if let Some(ov) = &mut app.diff_overlay { ov.sd.scroll_by(/*delta*/ 1); }
|
||||
needs_redraw = true;
|
||||
}
|
||||
KeyCode::Up | KeyCode::Char('k') => {
|
||||
if let Some(ov) = &mut app.diff_overlay { ov.sd.scroll_by(-1); }
|
||||
if let Some(ov) = &mut app.diff_overlay { ov.sd.scroll_by(/*delta*/ -1); }
|
||||
needs_redraw = true;
|
||||
}
|
||||
KeyCode::PageDown | KeyCode::Char(' ') => {
|
||||
@@ -1721,7 +1724,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
KeyCode::PageUp => { if let Some(m) = app.env_modal.as_mut() { let step = 10usize; m.selected = m.selected.saturating_sub(step); } needs_redraw = true; }
|
||||
KeyCode::Char('n') => {
|
||||
if app.env_filter.is_none() {
|
||||
app.new_task = Some(crate::new_task::NewTaskPage::new(None, app.best_of_n));
|
||||
app.new_task = Some(crate::new_task::NewTaskPage::new(/*env_id*/ None, app.best_of_n));
|
||||
} else {
|
||||
app.new_task = Some(crate::new_task::NewTaskPage::new(app.env_filter.clone(), app.best_of_n));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user