Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(docs): ensure defaults are consistent #2177

Merged
merged 37 commits into from Nov 13, 2023
Merged

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented May 24, 2023

Created after seeing #2175.
Unfortunately there is currently no way to automatically detect issues where the jsdocs on the signature level differ from those on the options object because typedoc erases the signature ones if the option's one is present. But I found a way to at least check that the options one is present. And that the not-option ones match the js impl default one.

(it also can only check the last api signature)

@ST-DDT ST-DDT added c: docs Improvements or additions to documentation p: 1-normal Nothing urgent c: test labels May 24, 2023
@ST-DDT ST-DDT requested review from a team May 24, 2023 23:16
@ST-DDT ST-DDT self-assigned this May 24, 2023
scripts/apidoc/parameterDefaults.ts Outdated Show resolved Hide resolved
src/modules/datatype/index.ts Show resolved Hide resolved
src/modules/datatype/index.ts Show resolved Hide resolved
src/modules/random/index.ts Show resolved Hide resolved
src/modules/random/index.ts Show resolved Hide resolved
@ST-DDT ST-DDT marked this pull request as draft May 24, 2023 23:31
@codecov
Copy link

codecov bot commented May 24, 2023

Codecov Report

Merging #2177 (c2aff9e) into next (7ce8c28) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2177      +/-   ##
==========================================
- Coverage   99.57%   99.57%   -0.01%     
==========================================
  Files        2801     2801              
  Lines      249842   249908      +66     
  Branches     1082     1080       -2     
==========================================
+ Hits       248792   248843      +51     
- Misses       1022     1037      +15     
  Partials       28       28              
Files Coverage Δ
src/modules/airline/index.ts 100.00% <100.00%> (ø)
src/modules/commerce/index.ts 100.00% <100.00%> (ø)
src/modules/datatype/index.ts 100.00% <100.00%> (ø)
src/modules/date/index.ts 100.00% <100.00%> (ø)
src/modules/finance/index.ts 100.00% <100.00%> (ø)
src/modules/helpers/index.ts 98.98% <100.00%> (ø)
src/modules/internet/index.ts 100.00% <100.00%> (ø)
src/modules/location/index.ts 99.04% <100.00%> (+0.02%) ⬆️
src/modules/number/index.ts 100.00% <100.00%> (ø)
src/modules/person/index.ts 97.99% <100.00%> (ø)
... and 3 more

... and 1 file with indirect coverage changes

@ST-DDT ST-DDT marked this pull request as ready for review May 24, 2023 23:55
@ST-DDT
Copy link
Member Author

ST-DDT commented Jul 19, 2023

Should we use Defaults to `{}`. everywhere or nowhere? I implemented this for ~10/50 locations.

@ST-DDT ST-DDT added the s: needs decision Needs team/maintainer decision label Jul 31, 2023
@ST-DDT
Copy link
Member Author

ST-DDT commented Oct 3, 2023

Team decision

We will omit/remove the empty options default for now in the jsdocs.
We will ensure all options parameters have a JS default value such as {} to ensure proper api docs defaults. (e.g. the color module doesn't have them yet) (separate PR: #2432)

@ST-DDT ST-DDT added s: accepted Accepted feature / Confirmed bug and removed s: needs decision Needs team/maintainer decision labels Oct 3, 2023
@ST-DDT ST-DDT requested review from xDivisionByZerox and a team October 20, 2023 08:31
@ST-DDT ST-DDT enabled auto-merge (squash) November 13, 2023 08:08
@ST-DDT ST-DDT merged commit a747854 into next Nov 13, 2023
20 checks passed
@ST-DDT ST-DDT deleted the test/jsdocs/default-assertions branch November 13, 2023 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: docs Improvements or additions to documentation c: test p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
No open projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants