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

doc: fix more type case inconsistencies #11697

Closed
wants to merge 1 commit into from

Conversation

silverwind
Copy link
Contributor

@silverwind silverwind commented Mar 5, 2017

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

Turns out I missed quite a few types in ff13619 because my sed skills weren't up to par. This commit should fix all remaining issues with primitive type cases.

I also made the syntax with multiple types consistent by removing any whitespace between curly braces. If more people prefer {type | type | type} over {type|type|type}, I can also change to that.

Type replacement was done with:

sed -i -E 's#(\{|\|)\s+?(Boolean|Null|Undefined|Number|String|Symbol)\s+?(\||\})#\1\L\2\3#g' *.md

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Mar 5, 2017
@@ -508,7 +508,7 @@ added: v5.10.0
-->

* `size` {Integer} The desired length of the new `Buffer`
* `fill` {string | Buffer | Integer} A value to pre-fill the new `Buffer` with.
* `fill` {string|Buffer|Integer} A value to pre-fill the new `Buffer` with.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integer needs to be fixed as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integer is not a valid type. Shall we change them all to number?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to be specific to keep Integer here because it doesn’t really make sense to pass in non-integer numbers here… the upper-casing is a bit weird but I’d be okay with it, as long as we try to be consistent

(also /cc @ameliavoncat whose awesome PRs also touch these parts of the docs and who might want to keep track of this discussion)

Copy link
Contributor Author

@silverwind silverwind Mar 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess it's better to keep it as-is. Per our rule discussed in the last PR, everything except the six primitives should be uppercased.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@silverwind in your commit that changed the case in the doctool, Integer was changed to integer. Either way it doesn't seem right to me that number and integer have different cases.

Copy link
Contributor Author

@silverwind silverwind Mar 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll move it out of jsPrimitives and into typeMap, possibly linking it to number docs.

* `key` : {String} - PEM encoded private key
* `passphrase` : {String} - passphrase for the private key
* `key` : {string} - PEM encoded private key
* `passphrase` : {string} - passphrase for the private key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you drop the spaces before the colons in this file? We don’t do that anywhere else in the docs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@silverwind
Copy link
Contributor Author

@TimothyGu d5d4274 fixes the Integer inconsistency in the doctool. I also added the missing undefined type, which results in a few new links in the doc. I still think we should keep it at Integer because we only lowercase the six primitives.

@TimothyGu
Copy link
Member

I still think we should keep it at Integer because we only lowercase the six primitives.

But the issue at hand is that an integer is expressed as a number primitive.

I also just looked at a proposal in TypeScript to add integral types, and though not yet accepted, it also uses lower cased type name (int). And AFAICT, there isn't any disagreement in that thread about its capitalization.

@silverwind
Copy link
Contributor Author

@TimothyGu okay, lowercased integer. I guess a argument could be made about it not being a valid constructor. It's really a odd type, but I see its value in documentation.

@silverwind silverwind force-pushed the type-fixes-part-2 branch 2 times, most recently from 6acf5f0 to 2d3068b Compare March 8, 2017 16:14
@silverwind
Copy link
Contributor Author

Landed in 5f32024.

@silverwind silverwind closed this Mar 8, 2017
silverwind added a commit that referenced this pull request Mar 8, 2017
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: #11697
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
@silverwind silverwind deleted the type-fixes-part-2 branch March 8, 2017 16:22
silverwind added a commit to silverwind/node that referenced this pull request Mar 8, 2017
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: nodejs#11697
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Mar 13, 2017
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: nodejs#11697
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
jungx098 pushed a commit to jungx098/node that referenced this pull request Mar 21, 2017
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: nodejs#11697
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
@MylesBorins
Copy link
Contributor

Do we want to backport to v6.x?

@silverwind
Copy link
Contributor Author

I'd say it's not strictly necessary, but it could make landing future doc backports easier.

Ideally, these commits should be landed in tandem:

ff13619
9be03a2
172be50
5f32024

@MylesBorins
Copy link
Contributor

@silverwind would you be willing to put together a PR with those commits?

@silverwind
Copy link
Contributor Author

@MylesBorins not right now, I'm busy on other projects. But if you can wait a bit, I can put something together later.

@silverwind
Copy link
Contributor Author

Backport in #13054

gibfahn pushed a commit that referenced this pull request May 16, 2017
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: #11697
Backport-PR-URL: #13054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
MylesBorins pushed a commit that referenced this pull request May 18, 2017
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: #11697
Backport-PR-URL: #13054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
silverwind added a commit to silverwind/node that referenced this pull request May 18, 2017
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: nodejs#11697
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
gibfahn pushed a commit to gibfahn/node that referenced this pull request Jun 17, 2017
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: nodejs#11697
Backport-PR-URL: nodejs#13054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
gibfahn pushed a commit that referenced this pull request Jun 20, 2017
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: #11697
Backport-PR-URL: #13054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jul 11, 2017
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: #11697
Backport-PR-URL: #13054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants