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

return this from public/external method #22950

Closed
wants to merge 3 commits into from

Conversation

ORESoftware
Copy link
Contributor

return this from ReadStream.prototype.setRawMode().

@nodejs-github-bot nodejs-github-bot added the tty Issues and PRs related to the tty subsystem. label Sep 19, 2018
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Would you be able to make the commit message a bit more precise, e.g. refer to setRawMode (and start the message with tty:, since this module is being changed)?

@ORESoftware
Copy link
Contributor Author

@addaleax sure, how about:

lib/tty.js: ReadStream.prototype.setRawMode() => return this;

?

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

LGTM but we should update the docs accordingly.

@ORESoftware
Copy link
Contributor Author

@BridgeAR sure if the docs are in the same repo I can update those while I change the commit message, can you link to the right docs page?

@addaleax
Copy link
Member

@ORESoftware It’s usually only tty: (like the messages in our changelog). Something like tty: make setRawMode() return this also works for me.

The docs are in doc/api/tty.md. :)

@vsemozhetbyt
Copy link
Contributor

It seems this needs to be documented in doc/api/tty.md#readstreamsetrawmodemode

Example.

@ORESoftware
Copy link
Contributor Author

@addaleax Ok updated docs and fixed commit message, lmk if that looks good

doc/api/tty.md Outdated
@@ -63,7 +63,7 @@ added: v0.7.7
* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a
raw device. If `false`, configures the `tty.ReadStream` to operate in its
default mode. The `readStream.isRaw` property will be set to the resulting
mode.
mode. Returns `this` - the read stream instance.
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs to be on a separate line:

* Returns: {this} - the read stream instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fml lol

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so it needs to be {this} not this, is that right?

Copy link
Member

Choose a reason for hiding this comment

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

yes correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

please check the new commit to see if it's right, thanks

Copy link
Member

Choose a reason for hiding this comment

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

It should be what @vsemozhetbyt put in his comment, verbatim :)

@jasnell jasnell added the semver-minor PRs that contain new features and should be released in the next minor version. label Sep 19, 2018
Copy link
Member

@lpinca lpinca left a comment

Choose a reason for hiding this comment

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

LGTM with @vsemozhetbyt's nit addressed.

doc/api/tty.md Outdated
mode.
mode.

Returns {this} - the read stream instance.
Copy link
Member

Choose a reason for hiding this comment

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

s/Returns/Returns:/

Copy link
Contributor

@vsemozhetbyt vsemozhetbyt Sep 19, 2018

Choose a reason for hiding this comment

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

Sorry, I did not explain: our docs are parsed and processed with tools (converters into HTML and JSON), so some format unification is needed. This should be literally:

* Returns: {this} - the read stream instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I wasn't sure, will fix, I get it

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

Just re-affirming my existing LGTM :)

@addaleax
Copy link
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/17357/

Whoever lands this, please add “Fixes: https://github.com/nodejs/node/issues/22916” to the commit message

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt pushed a commit that referenced this pull request Sep 22, 2018
PR-URL: #22950
Fixes: #22916
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
@vsemozhetbyt
Copy link
Contributor

Landed in 1f4d4c0 (with "Fixes:" added and some doc nits fixed).

Thank you, @ORESoftware!

targos pushed a commit that referenced this pull request Sep 23, 2018
PR-URL: #22950
Fixes: #22916
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor PRs that contain new features and should be released in the next minor version. tty Issues and PRs related to the tty subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants