Skip to content

docs: fix missing examples and fix spacing - #16006

Merged
kgryte merged 3 commits into
developfrom
claude/cool-johnson-yr834g
Oct 11, 2026
Merged

kgryte merged 3 commits into
developfrom
claude/cool-johnson-yr834g

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • adds the missing @example blocks to math/base/special/erfinvf/lib/native.js and normalizes two one-off parenthesis-spacing deviations in math/base/special/acsc and math/base/special/erfcx, each the sole outlier against a ≥99% namespace convention.

Namespace summary

  • Namespace: @stdlib/math/base/special. 384 members, 376 with a native addon, none autogenerated. Generated polyval_*/rational_* helper files were excluded from extraction.
  • Features analyzed: file tree, package.json top-level/scripts/__stdlib__ keys, manifest.json keys, README ##/### sections, and, for lib/{main,native,index}.js, the exported signature, JSDoc tags (@param, @returns, @throws, @example, @private), error construction, @module path, and the tryRequire/skip boilerplate in native tests and benchmarks.
  • Clear majority (≥75%): the full native file tree, the standard package.json key set, ## Usage/## Examples/## C APIs README sections, and JSDoc @param/@returns/@example on main.js and native.js.
  • No clear majority (excluded): __stdlib__ in package.json (269/384) and ## See Also (237/384, generator-owned).

math/base/special/erfinvf

lib/native.js is the only one of 376 native wrappers in the namespace without @example blocks (375/376, 99.7%). The added examples are copied verbatim from lib/main.js, the same way erfinv/lib/native.js repeats its main.js examples. src/main.c handles the same special cases as the JS implementation, and the addon is single precision, so the annotated values hold for the native path.

math/base/special/acsc

benchmark/benchmark.native.js writes (acsc instanceof Error) with no spaces inside the parentheses. The other 375 native benchmarks use the spaced form, and this is the only unspaced occurrence in stdlib (4887 files use the spaced form). The change is whitespace only.

math/base/special/erfcx

test/test.native.js writes resolve(__dirname, ...) with no space after the opening parenthesis. The other 375 native test files use the spaced form, and this is the only unspaced occurrence in stdlib (6004 files use the spaced form). The change is whitespace only.

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

  • Structural features were extracted for all 384 members, and majorities were computed at a 75% threshold.
  • Semantic features were extracted by static analysis of lib/{main,native,index}.js for all members. A per-package agent pass over 384 packages would have been rate-limit bound.
  • Each correction was checked by three independent reviewers covering semantic intent, cross-references and structure. All three returned confirmed-drift for each correction. One of them confirmed that the jsdoc-doctest lint rule skips native.js when the addon is unbuilt, and that the annotated values match erfinvf/src/main.c.

Deliberately excluded

  • gammaincinv/lib/main.js missing @example: open PR docs: add JSDoc examples to math/base/special/gammaincinv #15948 already covers it.
  • Native addon files in maxn, minn, maxabsn, minabsn, minmaxn, minmaxabsn, sici and the fast parent: these are pure JS by design. The first six are variadic, sici returns an array, and fast is a namespace package.
  • benchmark/c/native/ in cfloor, hyp2f1, sqrtpif: adding it means writing package-specific C, which is not a mechanical fix.

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 helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was authored by Claude Code on behalf of @Planeshifter as an automated cross-package drift audit of @stdlib/math/base/special. Agents validated the findings, and a maintainer will review them before the PR leaves draft.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01E6E4g9jgiqjd2XenrYCtu8


Generated by Claude Code

claude added 3 commits October 9, 2026 12:40
Added missing `@example` blocks to `lib/native.js`, mirroring `lib/main.js` (present in 375 of 376 native `lib/native.js` files in `math/base/special`; 99.7%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E6E4g9jgiqjd2XenrYCtu8
Normalized `( acsc instanceof Error )` parenthesis spacing in `benchmark/benchmark.native.js` (spaced form used in 375 of 376 native benchmarks in `math/base/special`; the unspaced form is the only occurrence in stdlib).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E6E4g9jgiqjd2XenrYCtu8
Normalized `resolve( __dirname, ... )` parenthesis spacing in `test/test.native.js` (spaced form used in 375 of 376 native test files in `math/base/special`; the unspaced form is the only occurrence in stdlib).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E6E4g9jgiqjd2XenrYCtu8
@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Oct 9, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/acsc $\\color{green}178/178$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}178/178$
$\\color{green}+100.00\\%$
math/base/special/erfcx $\\color{red}1368/1443$
$\\color{green}+94.80\\%$
$\\color{green}95/95$
$\\color{green}+100.00\\%$
$\\color{red}79/104$
$\\color{green}+75.96\\%$
$\\color{red}1368/1443$
$\\color{green}+94.80\\%$
math/base/special/erfinvf $\\color{red}608/626$
$\\color{green}+97.12\\%$
$\\color{red}41/50$
$\\color{green}+82.00\\%$
$\\color{green}6/6$
$\\color{green}+100.00\\%$
$\\color{red}608/626$
$\\color{green}+97.12\\%$

The above coverage report was generated for the changes in this PR.

@kgryte
kgryte marked this pull request as ready for review October 11, 2026 12:41
@kgryte
kgryte requested a review from a team October 11, 2026 12:41
@kgryte kgryte changed the title docs: add JSDoc examples to math/base/special/erfinvf native wrapper and fix spacing in acsc and erfcx docs: fix missing examples and fix spacing Oct 11, 2026
@kgryte
kgryte merged commit 4c5e602 into develop Oct 11, 2026
36 checks passed
@kgryte
kgryte deleted the claude/cool-johnson-yr834g branch October 11, 2026 12:42
@kgryte kgryte added the Documentation Improvements, additions, or changes to documentation. label Oct 11, 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 Oct 11, 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. Math Issue or pull request specific to math functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants