Documentation
¶
Overview ¶
idlint walks pkg/webapi and pkg/webauth, extracts every @ID value appearing in a top-level function's doc comment (via the Go AST — including `/* */` block comments which a plain grep would miss), and asserts that each value is declared as a string constant in pkg/webapi/docs/op_ids.go.
The stale grep-based `make docs-lint` target this tool replaces had three gaps: it ignored block comments entirely, it matched mid-line `@ID` references (anywhere, not just in annotation doc blocks), and it had no understanding of Go syntax so stray occurrences in unrelated strings or comments would trigger false positives.
Usage:
go run ./pkg/webapi/docs/cmd/idlint
Exits non-zero with a diagnostic listing every @ID value that isn't a registered constant in op_ids.go.