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

Fix: avoid creating invalid regex in no-warning-comments (fixes #11471) #11472

Merged
merged 1 commit into from Mar 5, 2019

Conversation

Projects
None yet
3 participants
@not-an-aardvark
Copy link
Member

not-an-aardvark commented Mar 4, 2019

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

[x] Bug fix

See #11471

What changes did you make? (Give an overview)

5018378 changed the codebase to use unicode regexes almost everywhere, with the exception of places where regexes are constructed from user input. However, two issues occurred to cause a bug:

  • Due to an oversight, the regular expressions constructed in the no-warning-comments rule were changed to be unicode regexes even though those regexes were constructed from user input.
  • The no-warning-comments rule dynamically creates regexes with unnecessary escape characters, and unnecessary escape characters are invalid in unicode regexes.

This commit fixes the first issue. The second issue isn't a problem on its own, but it will need to be fixed in order to implement #11423.

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

Nothing in particular

Fix: avoid creating invalid regex in no-warning-comments (fixes #11471)
5018378 changed the codebase to use unicode regexes almost everywhere, with the exception of places where regexes are constructed from user input. However, two issues occurred to cause a bug:

* Due to an oversight, the regular expressions constructed in the `no-warning-comments` rule were changed to be unicode regexes even though those regexes were constructed from user input.
* The `no-warning-comments` rule dynamically creates regexes with unnecessary escape characters, and unnecessary escape characters are invalid in unicode regexes.

This commit fixes the first issue. The second issue isn't a problem on its own, but it will need to be fixed in order to implement #11423.
@g-plane

g-plane approved these changes Mar 4, 2019

Copy link
Member

g-plane left a comment

LGTM, thanks!

@not-an-aardvark not-an-aardvark merged commit 458053b into master Mar 5, 2019

5 checks passed

commit-message Commit message follows guidelines
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor This change is semver-patch
Details

@not-an-aardvark not-an-aardvark deleted the invalid-warning-comment-regexes branch Mar 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.