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

Minor fix params description for addPercent function #12669

Merged
merged 1 commit into from
May 8, 2018

Conversation

bee0060
Copy link
Contributor

@bee0060 bee0060 commented Apr 22, 2018

Just fix function's comment

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@@ -53,7 +53,8 @@ function generateMDTable(headers, body) {

/**
* Generates a user-readable string from a percentage change
* @param {string[]} headers
* @param {number} change
* @param {boolean} includeEmoji
*/
function addPercent(change, includeEmoji) {
if (!isFinite(change)) {
Copy link
Contributor Author

@bee0060 bee0060 Apr 22, 2018

Choose a reason for hiding this comment

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

I just read some code in dangerFile. And found code on line 65

if (/^-|^0(?:\.0+)$/.test(formatted)) {

I am not sure the purpose of this code, but when formatted equals -.2abc this .test(formatted) will also return true,( it will return true with any strings start with -) does it meet the expectation ? Or is it a bug?

If here just want to return formatted when change less than or equals 0, maybe replace this code by:

if (change <= 0) {

would be easier to understand.

Copy link
Contributor

Choose a reason for hiding this comment

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

formatted should never be an arbitrary string, so cases like -2.abc aren't really a concern.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@aweary aweary merged commit 3fb8be5 into facebook:master May 8, 2018
@aweary
Copy link
Contributor

aweary commented May 8, 2018

We generally avoid merging changes that don't include any actual features/bug fixes, but since these JSDoc headers can confuse contributors this change seems fine. Thanks!

@bee0060
Copy link
Contributor Author

bee0060 commented May 9, 2018

Thanks!
Yeah, this PR just a minor change of comment. I just started to read react's code. Hope I could contribute some actual features or bug fixing later.

@bee0060 bee0060 deleted the bugfix/comment-in-dangerfile branch January 5, 2022 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants