Skip to content

chore: prune comments that restate the code - #28

Merged
rbstp merged 1 commit into
masterfrom
chore/trim-comments
Sep 7, 2026
Merged

rbstp merged 1 commit into
masterfrom
chore/trim-comments

Conversation

@rbstp

@rbstp rbstp commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

A pass over every file removing comments that say what the code already says. No code changed.

What went, outright rather than shortened:

  • Doc comments that paraphrase the name they sit above (/// The last window accepted as a focus target. over lastResolved).
  • Type-level essays restating the mechanism the code below implements.
  • Second paragraphs that elaborate on a first paragraph that was already enough.
  • /// Nil when ... restatements of an Optional, and /// Returns ... restatements of a return
    type.

What stayed is only what the code cannot show: platform quirks (Carbon refuses a combination the
same process holds; a template NSImage is a mask, so a flash colour must be drawn in rather than
tinted on; bootout rather than stop because KeepAlive restarts a stopped job), why an obvious
approach was rejected (the window server cannot answer "did focus move", so it is sampled; a window
server number rather than a frame, because two maximised windows share a frame), cost notes that
justify a shape (a ring build is many cross-process calls), and thread ownership.

before after
Sources/ 620 404
Tests/ 178 166

Test comments were left nearly alone on purpose. They mostly record the real-world scenario a case
models — "a Space switch shows a different window under a pointer that never moved", "launchd starts
Heed with no arguments, and macOS can add a -psn_ one" — which the test name cannot carry. Only the
12 that repeated their own function name went.

Agent.swift kept the most (271 of the 404), because that is where the domain knowledge lives:
almost every comment in it is a guard explaining why it is not the obvious thing. Happy to go
further there if it is still too much.

266 tests pass and make check-package passes. git diff master -- Sources Tests with comment
lines filtered out is empty.

Base automatically changed from fix/shortcut-modifier-self-collision to master September 7, 2026 03:52
@rbstp
rbstp force-pushed the chore/trim-comments branch from 6fedf7f to 1808cd6 Compare September 7, 2026 03:53
@rbstp
rbstp merged commit 762c6e8 into master Sep 7, 2026
1 check passed
@rbstp
rbstp deleted the chore/trim-comments branch September 7, 2026 03:56
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