Skip to content

docs: add JSDoc example and remove annotation - #15523

Merged
kgryte merged 1 commit into
developfrom
philipp/drift-tools-licenses-2026-09-25
Sep 25, 2026
Merged

kgryte merged 1 commit into
developfrom
philipp/drift-tools-licenses-2026-09-25

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request corrects two JSDoc deviations in @stdlib/_tools/licenses/infer that a cross-package consistency audit of the _tools/licenses namespace identified as unintentional.

This pull request:

  • adds an @example block to the main function JSDoc in lib/node_modules/@stdlib/_tools/licenses/infer/lib/main.js
  • removes the @private annotation from that same JSDoc comment

Namespace summary

  • Namespace: @stdlib/_tools/licenses
  • Members analyzed: 11 (none autogenerated)
  • Conformance threshold: 75%, i.e. ≥9 of 11
  • Features with a clear majority (9): main-function JSDoc @param (11/11), @throws (10/11), @example (10/11), absence of @private (10/11) and @returns (9/11); README top-level ## Examples section (10/11); test/ directory together with package.json directories.test (10/11); error construction via format (9/11); package.json core key set (11/11).
  • Features without a clear majority, excluded from analysis (6): presence of bin/, docs/, etc/ (7/11 each); package.json bin, __stdlib__ and os keys (6–7/11); return kind (value 6 / void 5); @returns tag descriptions (6/11); README section ordering (the longest contiguous subsequence reaching 75% is ## Usage alone); CLI subsection ordering (only 7/11 members have a ## CLI section at all).

@stdlib/_tools/licenses/infer

Adds a missing @example block and removes an incorrect @private annotation from lib/main.js. Across the 11-member _tools/licenses namespace, 10/11 packages (91%) document their main export with @example, and 10/11 (91%) leave it unmarked as private; infer was the sole outlier on both counts, despite being a public export — package.json points main to ./lib, lib/index.js re-exports it as @stdlib/_tools/licenses/infer, the README documents infer( pkgs, pattern, clbk ), and the package ships a licenses-infer CLI binary. The added example mirrors the existing @module block in lib/index.js and the runnable examples/index.js. The genuinely private helpers read_files.js and infer_license.js retain their @private annotations. No runtime behavior, signature, or test expectations change.

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Validation

Checked:

  • Structural extraction across all 11 members: file trees, package.json top-level/scripts/stdlib key sets, README ##/### heading sequences, and test/, benchmark/, examples/ file naming.
  • Semantic extraction via one agent per package over lib/main.js, lib/index.js and lib/validate.js: public signature, return kind, validation prologue, error construction, JSDoc shape, and require()-derived dependencies. All 11 returned parseable results; none needed a retry or exclusion.
  • Three-agent validation of each candidate correction: semantic review (intentional difference vs. stale style), cross-reference (whether tests, examples, CLI wrappers or lint rules depend on the deviating form), and structural review (whether the majority pattern is the right thing to apply).
  • Syntax of the added JSDoc example, and tag ordering against stdlib/jsdoc-tag-order. The repository's make lint-javascript-files target could not be run in this environment because node_modules is not installed; the change is confined to a comment block and the file parses.

Deliberately excluded:

  • @returns {void} for infer and licenses (9/11, 82%). Both functions have no top-level return statement, and jsdoc/require-returns (etc/eslint/rules/programmer_errors.js) only requires the tag when a function returns. Repo-wide in _tools, main functions without a return omit @returns. The apparent majority tracks control flow, not convention.
  • @throws tags for infer (10/11, 91%). infer() performs no argument validation and has no throw sites, so the tags would document behavior that does not exist. Adding validation to match its siblings would be a behavior change, not a documentation fix.
  • README ## Examples section for infer (10/11, 91%). The section exists as an unfilled, commented-out generator placeholder. tools/git/hooks/pre-push runs make markdown-examples-javascript-files on changed READMEs, which executes README example JavaScript; filling this placeholder would turn inert text into a full read-installed scan plus a per-package glob on every push, and needs to be verified by execution rather than applied mechanically. The same placeholder state is present in all seven _tools/licenses/reporters/* READMEs, so it is a namespace-wide gap rather than a single-package outlier.
  • test/ directory and directories.test for infer (10/11, 91%). Sibling suites are 61–643 lines of package-specific assertions exercising real license-inference behavior. Authoring one requires domain judgment, not a mechanical scaffold.
  • Features listed above as lacking a 75% majority.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance.

This pull request was authored by Claude Code. The namespace was surveyed programmatically, per-package feature extraction and the review of each candidate correction were delegated to AI agents, and the resulting diff — two edits to a single JSDoc comment — was reviewed before committing. Candidate corrections that any reviewing agent judged to be intentional deviations, or to require human judgment, were dropped and are listed above under "Deliberately excluded".


🤖 Generated with Claude Code

https://claude.ai/code/session_014z95KjCnaJkD39ZMk2Jpek


Generated by Claude Code

Add an `@example` block to the main function JSDoc. Ten of the eleven
packages in the `_tools/licenses` namespace (91%) document their main
export with an `@example`; `infer` was the sole exception. The example
mirrors the module-level example already present in the package's
`lib/index.js` and the runnable `examples/index.js`.

Remove the `@private` annotation from the same JSDoc comment. The
annotated function is the package's public export: `main` resolves to
`./lib`, `lib/index.js` re-exports it under the
`@stdlib/_tools/licenses/infer` module name, the README documents
`infer( pkgs, pattern, clbk )` as the package API, and the package
installs a `licenses-infer` CLI binary. No other main export in the
namespace carries `@private` (10 of 11, 91%); the genuinely internal
helpers in the same directory, `read_files.js` and `infer_license.js`,
are the ones legitimately annotated.

Both changes are confined to a documentation comment and leave runtime
behavior, the public signature, and test expectations unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014z95KjCnaJkD39ZMk2Jpek
@stdlib-bot stdlib-bot added the Tools Issue or pull request related to project tooling. label Sep 25, 2026
@kgryte
kgryte marked this pull request as ready for review September 25, 2026 06:52
@kgryte
kgryte requested a review from a team September 25, 2026 06:52
@kgryte kgryte changed the title docs: add JSDoc example and drop @private in _tools/licenses/infer docs: add JSDoc example and remove annotation Sep 25, 2026
@kgryte
kgryte merged commit eb6e67d into develop Sep 25, 2026
31 checks passed
@kgryte
kgryte deleted the philipp/drift-tools-licenses-2026-09-25 branch September 25, 2026 06:55
@kgryte kgryte added the Documentation Improvements, additions, or changes to documentation. label Sep 25, 2026
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements, additions, or changes to documentation. Tools Issue or pull request related to project tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants