Skip to content

chore: strip comments from code and config - #504

Merged
lg2m merged 4 commits into
mainfrom
chore/strip-comments
Oct 29, 2026
Merged

lg2m merged 4 commits into
mainfrom
chore/strip-comments

Conversation

@lg2m

@lg2m lg2m commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Change

Removes every comment from the repository's code and config. Comments had been leading agents to write hacks and explain them in prose instead of fixing the cause. AGENTS.md already forbids new comments; this clears out the old ones.

  • Rust: //, /// and //! removed from every tracked .rs file, about 17.7k lines (the repo has no /* */ blocks). TOML, workflow YAML, shell and Python scripts lose their # comments.
  • What remains:
    • clap doc comments in src/cli.rs and xtask/src/*.rs, because they become --help text;
    • // lint: allow(sleep) markers, which xtask/src/lint.rs reads;
    • shebangs and Python docstrings (argparse uses __doc__).
  • No doctests remained, so the full-scope doctest gate is gone from cargo xtask check.
  • The strip is generated. e4490327 is the unedited output of a syntax-aware stripper followed by cargo fmt --all. It understands escapes, raw strings, byte strings, char literals vs lifetimes, and nested block comments. The three commits after it are hand edits:
    • drop the doctest gate;
    • rewrite an if whose whole body was a comment;
    • rekey xtask/src/legacy-sleeps.txt to the new line numbers.

The 31 hacks those comments explained are filed as ENG-1112 to ENG-1142 under ENG-1111.

Verification

  • cargo xtask check: passed on 0a6281c2 (full workspace, 86 s).
  • Running the stripper on a fresh origin/main (a41ba3ff), then cargo fmt --all, reproduces e4490327 byte for byte. Running it again changes 0 files.
  • Every string and char literal in all 311 .rs files is unchanged, except the deleted "doctest" gate. Apart from comments and whitespace, the only token changes are reflows by cargo fmt.
  • --help and -h for every qq subcommand (83 sections) and every xtask subcommand, including hidden perf workers (43 sections), are identical before and after. The only difference is the commit hash in qq --version.

Known impact

  • Open branches will conflict on comment lines. To resolve: rebase onto main, rerun the stripper, and run cargo fmt --all.
  • One # shellcheck disable=SC1091 directive went with the other comments. Nothing in CI runs shellcheck.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T22:07:22.080790Z 0a6281c Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 0a6281c27b

ℹ️ 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".

@lg2m
lg2m merged commit 1a83fcb into main Oct 29, 2026
10 checks passed
@lg2m
lg2m deleted the chore/strip-comments branch October 29, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant