Skip to content

go-linter-driven-development v2.9.1 — visibility default: private symbols get no comment

Choose a tag to compare

@buzzdan buzzdan released this 23 Jul 20:26
· 89 commits to main since this release
19f54c1

A real 143-line file surfaced the gap v2.9.0 left open: every one of its nine unexported symbols carried a comment — one of them 22 prose lines — because the tier budget caps a comment's size but nothing decided whether it should exist.

Added

  • Visibility default (R9) — unexported symbols get no comment. The name is the documentation; a name that needs a comment wants a rename or an extraction (R3) first. The special case is one line carrying a very high-value toolbox item: an ordering constraint, an external library quirk, the WHY of a magic number, the package's one real policy. Anything more moves to the exported caller, the package doc, or the feature doc. The tier table now explicitly prices exported API only.
  • New case file examples/private-comment-noise.md — the nine-helper file with per-symbol verdicts (four one-liners survive, five comments deleted; ~68 comment lines become 4) and the full "after". Rides in the comment-critic's spawn payload from both @pre-commit-review and @documentation.
  • New anti-toolbox entry: review-defense narration — the writer arguing with an imagined reviewer ("bounds-checked: it never indexes an empty slice", "deliberately narrow — not a generalized table"). The code shows its own safety; a design choice worth defending is defended in the feature doc.
  • Critic bias for unexported symbols — the question is existence, not size: default verdict DELETE; TRIM down to the one high-value line only when it already exists; never grow a private comment.
  • @documentation writes accordingly — FEATURE step 3 writes godocs for exported symbols only by default, so the noise is not written in the first place.

Field test

Run without the answer key (case file withheld from the payload): 9 comments — 0 KEEP / 3 TRIM / 2 REWRITE / 4 DELETE, matching the case file on 8 of 9 verdicts. The critic also routed the one over-budget-but-genuine WHY up to the exported caller instead of deleting the knowledge.

Full details in CHANGELOG.md.