refactor: rename test/example namespace var to constants in three @stdlib/constants/* outliers#13057
Draft
Planeshifter wants to merge 3 commits into
Draft
refactor: rename test/example namespace var to constants in three @stdlib/constants/* outliers#13057Planeshifter wants to merge 3 commits into
constants in three @stdlib/constants/* outliers#13057Planeshifter wants to merge 3 commits into
Conversation
…b/constants/array`
Renames the local `ns` binding to `constants` in `test/test.js` and
`examples/index.js`, and aligns the second `tape` description
(`'the exported object contains key-value pairs'`) with the wording
used by the rest of the namespace (`'the exported object contains
constants'`).
Drift items corrected:
- `test/test.js` namespace var name: `constants` (12/15 = 80% of
`@stdlib/constants/*` siblings; matches the `constants` binding
used by the package's own `README.md` Usage block).
- `examples/index.js` namespace var name: `constants` (12/15 = 80%).
- `test/test.js` description string: `'the exported object contains
constants'` (12/15 = 80%).
Pure rename; no public API, runtime behavior, test assertion, or
import path is changed. Copyright header and `lib/index.js` are
deliberately left untouched (no clear majority for `lib/index.js`
namespace var name across `@stdlib/constants/*`: 9/15 = 60%).
…b/constants/path`
Renames the local `ns` binding to `constants` in `test/test.js` and
`examples/index.js`, and aligns the second `tape` description
(`'the exported object contains key-value pairs'`) with the wording
used by the rest of the namespace (`'the exported object contains
constants'`).
Drift items corrected:
- `test/test.js` namespace var name: `constants` (12/15 = 80% of
`@stdlib/constants/*` siblings; matches the `constants` binding
used by the package's own `README.md` Usage block).
- `examples/index.js` namespace var name: `constants` (12/15 = 80%).
- `test/test.js` description string: `'the exported object contains
constants'` (12/15 = 80%).
Pure rename; no public API, runtime behavior, test assertion, or
import path is changed. Copyright header and `lib/index.js` are
deliberately left untouched (no clear majority for `lib/index.js`
namespace var name across `@stdlib/constants/*`: 9/15 = 60%).
…b/constants/unicode`
Renames the local `ns` binding to `constants` in `test/test.js` and
`examples/index.js`, and aligns the second `tape` description
(`'the exported object contains key-value pairs'`) with the wording
used by the rest of the namespace (`'the exported object contains
constants'`).
Drift items corrected:
- `test/test.js` namespace var name: `constants` (12/15 = 80% of
`@stdlib/constants/*` siblings; matches the `constants` binding
used by the package's own `README.md` Usage block).
- `examples/index.js` namespace var name: `constants` (12/15 = 80%).
- `test/test.js` description string: `'the exported object contains
constants'` (12/15 = 80%).
Pure rename; no public API, runtime behavior, test assertion, or
import path is changed. Copyright header and `lib/index.js` are
deliberately left untouched (no clear majority for `lib/index.js`
namespace var name across `@stdlib/constants/*`: 9/15 = 60%).
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
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:
nstoconstantsintest/test.jsandexamples/index.jsof three outlier packages in the@stdlib/constants/*namespace (array,path,unicode), and aligns the correspondingtapedescription string. Pure rename — no public API, runtime behavior, test assertion, or import path is changed.Namespace summary
@stdlib/constants(15 direct child packages —array,complex128,complex64,float16,float32,float64,int16,int32,int8,path,time,uint16,uint32,uint8,unicode; all non-autogenerated).package.jsontop-level/scripts/stdlibkeys,docs/types/{index.d.ts,test.ts}presence, README heading sequence,lib/index.jsprologue + export var,test/test.jsbody (var name + description string),examples/index.jsbody (var name),README.mdUsage var name.package.jsonshape (100%),docs/types/presence (100%), README headings## Usage/#### constants/## Examples(100%),lib/index.jsprologue (100%),docs/types/test.tsbody (100% — byte-identical),README.mdUsage var nameconstants(100%),test/test.js+examples/index.jsnamespace var nameconstants(12/15 = 80%),test/test.jssecond-tape description'the exported object contains constants'(12/15 = 80%).lib/index.jsnamespace var name (9/15 = 60%constantsvs 6/15ns— below threshold, not corrected);examples/index.jscopyright year (13/15 = 2021 vs 2/15 = 2018 — copyright is historical metadata, not stylistic drift, deliberately excluded).Per outlier package
@stdlib/constants/arraytest/test.jsandexamples/index.jswere the only two files in this package's surface usingvar ns = require( './../lib' ); the README's Usage block, by contrast, already documents the export asvar constants = require( '@stdlib/constants/array' ). Renamed toconstantsto match the documented user-facing name and the 80% sibling convention, and updated the secondtapedescription from'the exported object contains key-value pairs'to'the exported object contains constants'(same 80% conformance). 6 LOC across 2 files.@stdlib/constants/pathSame drift, same fix.
path/test/test.jsandpath/examples/index.jsusensdespite the README's Usage block readingvar constants = require( '@stdlib/constants/path' ); the test description is the stale'... key-value pairs'boilerplate. Both are renamed/aligned to the namespace majority (80% conformance on each item). 6 LOC across 2 files.@stdlib/constants/unicodeIdentical drift to
path— the test and example files are byte-for-byte clones of thepathversions. Renamedns→constantsin both files and updated the description string; the README's Usage already names the bindingconstants. 6 LOC across 2 files.Related Issues
No.
Questions
No.
Other
Validation
Checked:
package.jsonshape,docs/types/shape, README headings,lib/index.jsprologue, test/example body shapes).test/test.js+examples/index.jsnamespace var name + description string):array,path,unicode: thensbinding in test/example files is stale boilerplate that predates theconstantsuser-facing convention; no semantic difference distinguishes these three packages from the 12 majority siblings.requirereferences toconstants/{array,path,unicode}/{test,examples}, the'key-value pairs'description string is asserted by no external harness/fixture, and the binding is file-local. (Flagged for the local report: the scaffold template at_tools/scaffold/namespace/data/test/test__js.txtstill usesns/'key-value pairs', so the 12 siblings drifted away from the scaffold first — a separate generator-side issue, out of scope here.)constantsis the right majority pattern to standardize on (READMEs are 100%constantsand 80% of sibling test/example files agree); the fix is purely textual with no runtime or assertion impact.Deliberately excluded:
lib/index.jsnamespace var name — 60% conformance, below the 75% threshold; not touched.examples/index.jscopyright year — historical metadata, not drift.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running a cross-package drift-detection routine: the target namespace (
@stdlib/constants) was picked at random across all stdlib namespaces of ≥8 non-generated members, structural and semantic features were extracted for every member, majority patterns were computed at a 75% threshold, and three independent validation agents (two opus, one sonnet) confirmed each correction before it was applied. The only feature with a clear (≥75%) majority that had outliers was thetest/test.js+examples/index.jsnamespace var name (constants, 80% conformance) and the correspondingtapedescription string — both were mechanically renamed in the three outlier packages (array,path,unicode).@stdlib-js/reviewers
Generated by Claude Code