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

Update: Regex incorrectly checks newline in comments (fixes #12263) #12407

Merged
merged 1 commit into from Oct 20, 2019
Merged

Update: Regex incorrectly checks newline in comments (fixes #12263) #12407

merged 1 commit into from Oct 20, 2019

Conversation

@yeonjuan
Copy link
Member

@yeonjuan yeonjuan commented Oct 11, 2019

What is the purpose of this pull request? (put an "X" next to item)

[X] Bug fix (#12263)

What changes did you make? (Give an overview)
Fix regex in sourceCode.isSpaceBetweenTokens()

Is there anything you'd like reviewers to focus on?
#12263

@jsf-clabot
Copy link

@jsf-clabot jsf-clabot commented Oct 11, 2019

CLA assistant check
All committers have signed the CLA.

@eslint-deprecated eslint-deprecated bot added the triage label Oct 11, 2019
Copy link
Member

@kaicataldo kaicataldo left a comment

Thanks for working on this!

lib/source-code/source-code.js Outdated Show resolved Hide resolved
@kaicataldo kaicataldo added accepted bug core and removed triage labels Oct 11, 2019
@yeonjuan yeonjuan changed the title Fix: isSpaceBetweenTokens() sees newline in multiline block comments as spaces(fixes #12263) Fix: isSpaceBetweenTokens() sees newline in multiline block comments as spaces (fixes #12263) Oct 11, 2019
@yeonjuan yeonjuan changed the title Fix: isSpaceBetweenTokens() sees newline in multiline block comments as spaces (fixes #12263) Fix: isSpaceBetweenTokens() incorrectly checks newline in comments (fixes #12263) Oct 11, 2019
@yeonjuan yeonjuan changed the title Fix: isSpaceBetweenTokens() incorrectly checks newline in comments (fixes #12263) Fix: Regex incorrectly checks newline in multiline comments (fixes #12263) Oct 11, 2019
@yeonjuan yeonjuan changed the title Fix: Regex incorrectly checks newline in multiline comments (fixes #12263) Fix: Regex incorrectly checks newline in comments (fixes #12263) Oct 11, 2019
Copy link
Member

@kaicataldo kaicataldo left a comment

LGTM, thanks!

@mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Oct 11, 2019

The change LGTM, but I think that the commit message and PR title should be Update: because this is a bug fix that can produce more warnings.

At the moment It's probably only a few core rules where that could happen.

Example:

/* eslint space-before-function-paren:["error", "always"]*/

function foo/* comment
*/(){}

function foo// comment
(){}

This can also affect plugins.

Might be also good to somehow check will the flag be transpiled for the online demo, because it isn't widely supported in browsers yet.

Copy link
Member

@platinumazure platinumazure left a comment

Looks good! I agree with @mdjermanovic, this should be an Update as this can add more lint messages in some cases.

Could you please edit the PR title to use the "Update:" prefix? Thanks!

@yeonjuan yeonjuan changed the title Fix: Regex incorrectly checks newline in comments (fixes #12263) Update: Regex incorrectly checks newline in comments (fixes #12263) Oct 12, 2019
@yeonjuan
Copy link
Member Author

@yeonjuan yeonjuan commented Oct 12, 2019

@platinumazure Ok! That make sense! Thanks!

Copy link
Member

@platinumazure platinumazure left a comment

Looks good. Thanks for changing the commit summary!

We can leave this open another day or two in case more teammates want to review this.

Copy link
Member

@mdjermanovic mdjermanovic left a comment

LGTM, thanks!

@platinumazure the commit message is still Fix:, maybe to leave it as is and change the message while merging the PR?

@platinumazure
Copy link
Member

@platinumazure platinumazure commented Oct 13, 2019

@platinumazure the commit message is still Fix:, maybe to leave it as is and change the message while merging the PR?

@mdjermanovic On the GitHub interface, the default/suggested merge commit message is the PR title if there are two or more commits. So if we merge using GitHub, it will suggest the PR title in this case. That's why the "commit-message" status check is currently passing and nothing needs to be done here.

(When there is only one commit, that commit's message is suggested/used, so in that case, we would need to edit it on merge.)

@platinumazure platinumazure merged commit 2d6e345 into eslint:master Oct 20, 2019
16 checks passed
16 checks passed
Verify Files
Details
Test (ubuntu-latest, 8.x)
Details
Test (ubuntu-latest, 10.x)
Details
Test (ubuntu-latest, 12.x)
Details
Test (windows-latest, 12.x)
Details
Test (macOS-latest, 12.x)
Details
Browser Test
Details
commit-message Commit message follows guidelines
Details
continuous-integration Build #20191019.5 succeeded
Details
continuous-integration (Test on Node.js 10 (Linux)) Test on Node.js 10 (Linux) succeeded
Details
continuous-integration (Test on Node.js 12 (Linux)) Test on Node.js 12 (Linux) succeeded
Details
continuous-integration (Test on Node.js 12 (Windows)) Test on Node.js 12 (Windows) succeeded
Details
continuous-integration (Test on Node.js 12 (macOS)) Test on Node.js 12 (macOS) succeeded
Details
continuous-integration (Test on Node.js 8 (Linux)) Test on Node.js 8 (Linux) succeeded
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor No patch release is pending
Details
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants