mirror of
https://github.com/openai/codex.git
synced 2026-04-30 09:26:44 +00:00
chore: clean up argument-comment lint and roll out all-target CI on macOS (#16054)
## Why `argument-comment-lint` was green in CI even though the repo still had many uncommented literal arguments. The main gap was target coverage: the repo wrapper did not force Cargo to inspect test-only call sites, so examples like the `latest_session_lookup_params(true, ...)` tests in `codex-rs/tui_app_server/src/lib.rs` never entered the blocking CI path. This change cleans up the existing backlog, makes the default repo lint path cover all Cargo targets, and starts rolling that stricter CI enforcement out on the platform where it is currently validated. ## What changed - mechanically fixed existing `argument-comment-lint` violations across the `codex-rs` workspace, including tests, examples, and benches - updated `tools/argument-comment-lint/run-prebuilt-linter.sh` and `tools/argument-comment-lint/run.sh` so non-`--fix` runs default to `--all-targets` unless the caller explicitly narrows the target set - fixed both wrappers so forwarded cargo arguments after `--` are preserved with a single separator - documented the new default behavior in `tools/argument-comment-lint/README.md` - updated `rust-ci` so the macOS lint lane keeps the plain wrapper invocation and therefore enforces `--all-targets`, while Linux and Windows temporarily pass `-- --lib --bins` That temporary CI split keeps the stricter all-targets check where it is already cleaned up, while leaving room to finish the remaining Linux- and Windows-specific target-gated cleanup before enabling `--all-targets` on those runners. The Linux and Windows failures on the intermediate revision were caused by the wrapper forwarding bug, not by additional lint findings in those lanes. ## Validation - `bash -n tools/argument-comment-lint/run.sh` - `bash -n tools/argument-comment-lint/run-prebuilt-linter.sh` - shell-level wrapper forwarding check for `-- --lib --bins` - shell-level wrapper forwarding check for `-- --tests` - `just argument-comment-lint` - `cargo test` in `tools/argument-comment-lint` - `cargo test -p codex-terminal-detection` ## Follow-up - Clean up remaining Linux-only target-gated callsites, then switch the Linux lint lane back to the plain wrapper invocation. - Clean up remaining Windows-only target-gated callsites, then switch the Windows lint lane back to the plain wrapper invocation.
This commit is contained in:
@@ -2174,7 +2174,7 @@ mod tests {
|
||||
async fn branch_override_is_used_when_provided() {
|
||||
let git_ref = resolve_git_ref_with_git_info(
|
||||
Some(&"feature/override".to_string()),
|
||||
&StubGitInfo::new(None, None),
|
||||
&StubGitInfo::new(/*default_branch*/ None, /*current_branch*/ None),
|
||||
)
|
||||
.await;
|
||||
|
||||
@@ -2185,7 +2185,7 @@ mod tests {
|
||||
async fn trims_override_whitespace() {
|
||||
let git_ref = resolve_git_ref_with_git_info(
|
||||
Some(&" feature/spaces ".to_string()),
|
||||
&StubGitInfo::new(None, None),
|
||||
&StubGitInfo::new(/*default_branch*/ None, /*current_branch*/ None),
|
||||
)
|
||||
.await;
|
||||
|
||||
@@ -2195,7 +2195,7 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn prefers_current_branch_when_available() {
|
||||
let git_ref = resolve_git_ref_with_git_info(
|
||||
None,
|
||||
/*branch_override*/ None,
|
||||
&StubGitInfo::new(
|
||||
Some("default-main".to_string()),
|
||||
Some("feature/current".to_string()),
|
||||
@@ -2209,8 +2209,8 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn falls_back_to_current_branch_when_default_is_missing() {
|
||||
let git_ref = resolve_git_ref_with_git_info(
|
||||
None,
|
||||
&StubGitInfo::new(None, Some("develop".to_string())),
|
||||
/*branch_override*/ None,
|
||||
&StubGitInfo::new(/*default_branch*/ None, Some("develop".to_string())),
|
||||
)
|
||||
.await;
|
||||
|
||||
@@ -2219,7 +2219,11 @@ mod tests {
|
||||
|
||||
#[tokio::test]
|
||||
async fn falls_back_to_main_when_no_git_info_is_available() {
|
||||
let git_ref = resolve_git_ref_with_git_info(None, &StubGitInfo::new(None, None)).await;
|
||||
let git_ref = resolve_git_ref_with_git_info(
|
||||
/*branch_override*/ None,
|
||||
&StubGitInfo::new(/*default_branch*/ None, /*current_branch*/ None),
|
||||
)
|
||||
.await;
|
||||
|
||||
assert_eq!(git_ref, "main");
|
||||
}
|
||||
@@ -2242,7 +2246,7 @@ mod tests {
|
||||
is_review: false,
|
||||
attempt_total: None,
|
||||
};
|
||||
let lines = format_task_status_lines(&task, now, false);
|
||||
let lines = format_task_status_lines(&task, now, /*colorize*/ false);
|
||||
assert_eq!(
|
||||
lines,
|
||||
vec![
|
||||
@@ -2267,7 +2271,7 @@ mod tests {
|
||||
is_review: false,
|
||||
attempt_total: Some(1),
|
||||
};
|
||||
let lines = format_task_status_lines(&task, now, false);
|
||||
let lines = format_task_status_lines(&task, now, /*colorize*/ false);
|
||||
assert_eq!(
|
||||
lines,
|
||||
vec![
|
||||
@@ -2309,7 +2313,12 @@ mod tests {
|
||||
attempt_total: Some(1),
|
||||
},
|
||||
];
|
||||
let lines = format_task_list_lines(&tasks, "https://chatgpt.com/backend-api", now, false);
|
||||
let lines = format_task_list_lines(
|
||||
&tasks,
|
||||
"https://chatgpt.com/backend-api",
|
||||
now,
|
||||
/*colorize*/ false,
|
||||
);
|
||||
assert_eq!(
|
||||
lines,
|
||||
vec![
|
||||
|
||||
Reference in New Issue
Block a user