Skip to content

chore: clean up argument-comment lint and roll out all-target CI on macOS#16054

Merged
bolinfest merged 1 commit intomainfrom
pr16054
Mar 28, 2026
Merged

chore: clean up argument-comment lint and roll out all-target CI on macOS#16054
bolinfest merged 1 commit intomainfrom
pr16054

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Mar 27, 2026

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.
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4fa041e7f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

continue
fi

lint_args+=("$arg")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip storing -- in lint args before forwarding cargo args

The parser appends every pre-separator token to lint_args before checking whether it is --, then later always appends another separator when cargo_args is non-empty. For calls that intentionally pass cargo flags (for example ./tools/argument-comment-lint/run.sh -p codex-core -- --tests), this builds ... -- -- --tests, so the forwarded target flag is no longer parsed as intended. This breaks the explicit target-selection override path introduced by this change; handle -- before pushing into lint_args (or suppress the extra separator when one was already consumed).

Useful? React with 👍 / 👎.

continue
fi

lint_args+=("$arg")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve single separator when forwarding prebuilt wrapper args

This wrapper has the same separator regression: -- is first stored in lint_args, and then a new -- is appended when reconstructing final_args with cargo_args. Any invocation that forwards cargo-level options via -- (for example ./tools/argument-comment-lint/run-prebuilt-linter.sh -p codex-core -- --tests) ends up with a doubled separator, so Cargo no longer receives the target-selection flag in the expected position. Please treat -- as a pure split marker instead of forwarding it twice.

Useful? React with 👍 / 👎.

@bolinfest bolinfest force-pushed the pr16054 branch 3 times, most recently from 28ac0c9 to 880a15a Compare March 28, 2026 00:21
@bolinfest bolinfest changed the title chore: enforce argument-comment lint across all targets Mar 28, 2026
@bolinfest bolinfest enabled auto-merge (squash) March 28, 2026 01:24
@bolinfest bolinfest disabled auto-merge March 28, 2026 02:00
@bolinfest bolinfest merged commit 61dfe0b into main Mar 28, 2026
67 of 76 checks passed
@bolinfest bolinfest deleted the pr16054 branch March 28, 2026 02:00
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

1 participant