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 infinite regex search & 'where' false positive in ConditionalBindingCascadeRule #348

Merged
merged 1 commit into from
Jan 13, 2016

Conversation

jpsim
Copy link
Collaborator

@jpsim jpsim commented Jan 13, 2016

Fixes #340 and #347 /cc @norio-nomura

@jpsim
Copy link
Collaborator Author

jpsim commented Jan 13, 2016

A small performance win too!

  • testSwiftLintLints in master: 2.246 seconds
  • testSwiftLintLints in this branch: 2.061 seconds

excludingSyntaxKinds: SyntaxKind.commentAndStringKinds()).map {
return file.matchPattern("^(if|guard)(.*?)let(.*?),(.*?)let(.*?)\\{",
excludingSyntaxKinds: SyntaxKind.commentAndStringKinds()).filter {
!(file.contents as NSString).substringWithRange($0).containsString("where")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm sure this could lead to some missed violations, but I'm not too concerned with that right now.

@jpsim
Copy link
Collaborator Author

jpsim commented Jan 13, 2016

Merging because it addresses a critical issue. @norio-nomura please let me know if you can think of a better way to handle where cases.

jpsim added a commit that referenced this pull request Jan 13, 2016
fix infinite regex search & 'where' false positive in ConditionalBindingCascadeRule
@jpsim jpsim merged commit 8584f0b into master Jan 13, 2016
@jpsim jpsim deleted the jp-conditional-binding-cascade-fixes branch January 13, 2016 02:47
@norio-nomura
Copy link
Collaborator

That's enough now! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants