Repository navigation
docs: add JSDoc example and remove annotation - #15523
Merged
Merged
Conversation
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
kgryte
approved these changes
Sep 25, 2026
@private in _tools/licenses/infer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request corrects two JSDoc deviations in
@stdlib/_tools/licenses/inferthat a cross-package consistency audit of the_tools/licensesnamespace identified as unintentional.This pull request:
@exampleblock to the main function JSDoc inlib/node_modules/@stdlib/_tools/licenses/infer/lib/main.js@privateannotation from that same JSDoc commentNamespace summary
@stdlib/_tools/licenses@param(11/11),@throws(10/11),@example(10/11), absence of@private(10/11) and@returns(9/11); README top-level## Examplessection (10/11);test/directory together withpackage.jsondirectories.test(10/11); error construction viaformat(9/11);package.jsoncore key set (11/11).bin/,docs/,etc/(7/11 each);package.jsonbin,__stdlib__andoskeys (6–7/11); return kind (value 6 / void 5);@returnstag descriptions (6/11); README section ordering (the longest contiguous subsequence reaching 75% is## Usagealone); CLI subsection ordering (only 7/11 members have a## CLIsection at all).@stdlib/_tools/licenses/inferAdds a missing
@exampleblock and removes an incorrect@privateannotation fromlib/main.js. Across the 11-member_tools/licensesnamespace, 10/11 packages (91%) document their main export with@example, and 10/11 (91%) leave it unmarked as private;inferwas the sole outlier on both counts, despite being a public export —package.jsonpointsmainto./lib,lib/index.jsre-exports it as@stdlib/_tools/licenses/infer, the README documentsinfer( pkgs, pattern, clbk ), and the package ships alicenses-inferCLI binary. The added example mirrors the existing@moduleblock inlib/index.jsand the runnableexamples/index.js. The genuinely private helpersread_files.jsandinfer_license.jsretain their@privateannotations. No runtime behavior, signature, or test expectations change.Related Issues
No.
Questions
No.
Other
Validation
Checked:
package.jsontop-level/scripts/stdlibkey sets, README##/###heading sequences, andtest/,benchmark/,examples/file naming.lib/main.js,lib/index.jsandlib/validate.js: public signature, return kind, validation prologue, error construction, JSDoc shape, andrequire()-derived dependencies. All 11 returned parseable results; none needed a retry or exclusion.stdlib/jsdoc-tag-order. The repository'smake lint-javascript-filestarget could not be run in this environment becausenode_modulesis not installed; the change is confined to a comment block and the file parses.Deliberately excluded:
@returns {void}forinferandlicenses(9/11, 82%). Both functions have no top-levelreturnstatement, andjsdoc/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.@throwstags forinfer(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.## Examplessection forinfer(10/11, 91%). The section exists as an unfilled, commented-out generator placeholder.tools/git/hooks/pre-pushrunsmake markdown-examples-javascript-fileson changed READMEs, which executes README example JavaScript; filling this placeholder would turn inert text into a fullread-installedscan 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 anddirectories.testforinfer(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.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
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