Skip to content

docs: put shell notes on their own line, not after the command - #164

Merged
groupsky merged 3 commits into
mainfrom
docs/92-no-trailing-shell-comments
Nov 9, 2026
Merged

groupsky merged 3 commits into
mainfrom
docs/92-no-trailing-shell-comments

Conversation

@groupsky

@groupsky groupsky commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Refs #92

Interactive zsh does not treat # as a comment unless interactivecomments is on (off by default). So a pasted cmd # note line passes # and the note to cmd. This PR puts each such note on its own line above the command, and adds a test that finds new ones.

Progress

  • No shell block in README.md, AGENTS.md or docs/ has a command line that ends in a # comment (19 lines moved: README, AGENTS, setup, both manual tests).
  • A short check finds none: docs_test.go, TestDocsShellLinesHaveNoTrailingComment. It runs in the normal go test ./... in CI. TestTrailingShellComments checks the finder itself (quotes, $#, URLs with #, TOML blocks, indented blocks).

Choices

  • A Go test, not a CI script: it runs with go test ./... already, needs no new tool, and runs on every developer's machine too.
  • It reads every Markdown file at the root and in docs/ (not only README, AGENTS and docs/, so that DESIGN.md is covered too), and blocks marked sh, bash, shell, zsh or console. All shell blocks in the docs are marked sh. TOML and other blocks are not checked (their comments are config, not shell).
  • A note on its own line still makes zsh print command not found: # (when interactivecomments is off). That is harmless: no command gets extra words. The issue asks for this form.

Review

  • Review subagent: no problems.
  • security-reviewer: no security findings. Its low notes (cover all Markdown files; say the harmless zsh error in the test comment) are fixed in 2nd commit. Not fixed: ~~~ fences and quotes over many lines; the docs use neither today.

@groupsky
groupsky marked this pull request as ready for review November 9, 2026 07:28
@groupsky
groupsky merged commit 146b7f8 into main Nov 9, 2026
7 checks passed
@groupsky
groupsky deleted the docs/92-no-trailing-shell-comments branch November 9, 2026 07:28
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