Repository navigation
Description
star lint go-style's section checks are substring tests, so a doc comment that merely mentions
Parameters: or Returns: satisfies them. No section is required.
// cmd/star/provider/goast/source_file.go, CheckCompliance
if len(d.Params) > 0 && !sf.isTestEntryPoint(d.Name) && !strings.Contains(text, "Parameters:") {
...
if d.Returns != "" && !strings.Contains(text, "Returns:") {How it was found
While reconciling a nine-violation delta on fix/994-go-style-fix-corrupts-headers, makeHeaderParagraph
was reported as missing its Returns section but not its Parameters section, though it has a
parameter. Its doc comment was:
// makeHeaderParagraph creates a paragraph containing just a section header (e.g., "Parameters:").The prose mention satisfied the check. The function had no Parameters: section and never would have been
asked for one.
Magnitude: small, and measured
Twelve comment lines in the repository mention Parameters: or Returns: outside a section header. Not all
of them mask a violation, but several plainly do:
| Line | Why it passes | What it is |
|---|---|---|
// Returns: The expanded path with ~ prefix replaced by the home directory |
contains Returns: |
a Returns section written inline on one line, not the required header-plus-list |
// Returns: true if the path is ignored, false if the path is not ignored. |
contains Returns: |
the same |
// Type Parameters: |
contains Parameters: |
a generic's type-parameter section, satisfying the ordinary parameter check |
// makeHeaderParagraph ... (e.g., "Parameters:") |
contains Parameters: |
a prose mention, nothing more |
So 3,850 is a small undercount, not a wrong number. This is filed for correctness of the gate rather
than for the size of the debt.
Why it matters anyway
Ruled 2026-09-30: "What I want: 100% of all lint issues found and fixed." A check satisfiable by a
substring cannot make that claim -- it is not a statement about the count, it is a statement about whether
the gate can be relied on at all. Worse, the inline // Returns: the expanded path form is the one a person
writes when they do not know the house style, which is exactly the case the linter exists to catch.
It is the same class of defect as
#997 -- a substring where a structure is meant --
and the same fix shape: check what the styler would produce, not whether a marker appears somewhere.
Not folded into the #994 branch, deliberately
Fixing this raises the violation count, and
the #994 plan
requires Phase 2 to leave the count where it found it, so that the fixer's change is provably not a change of
subject. Raising the count there would destroy that check.
Evidence of completion
-
Parameters:andReturns:are recognized as sections -- a paragraph whose whole text is the
header -- not as substrings anywhere in the comment. - A fixture whose doc comment mentions
Parameters:in prose is reported as missing the section. - A fixture carrying an inline
// Returns: somethingis reported as missing the section, because that
is not the house form. -
// Type Parameters:does not satisfy the ordinary parameter check; a generic function with value
parameters still needsParameters:. - The new count is measured and recorded, and the increase is explained per file rather than as a total.
- Whether each listed parameter needs a description is decided here or deferred explicitly, because
it is the difference between a scaffold passing and failing -- see star lint go-style --fix corrupts the SPDX header on every file it rewrites, and writes TODO placeholders instead of doc comments #994's Requirement 2 and The goast doc-comment styler's port was never finished: five items absent, ~90 lines of reflection still there, and an unknown production fails green #938.
Related documents
| Document | What it is |
|---|---|
| devlore-cli#994 | Where this was found; its Phase 2 must not move the count, which is why this is separate |
| devlore-cli#997 | The same substring-instead-of-structure defect in star lint copyright |
| devlore-cli#938 | The unfinished styler port; whether --fix may emit a section without descriptions is decided with this |
| devlore-cli#964 | The go-style sweep whose count this changes |
| go-style-guidelines.md | The house form these checks are meant to enforce |
Activity
fix(goast): the styler honors "Verbatim" on the way out, and invents …
David-Noble-at-work commentedon Nov 9, 2026
star github triage sweep added this issue to Triage: devlore, for the rule it breaks:
severity: a Bug whose Severity is blank; a bug is Critical, High, Medium or Low