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

Improve ControlStatementRule for issues #187 and #189 #195

Merged
merged 3 commits into from
Nov 11, 2015

Conversation

mmorier
Copy link
Contributor

@mmorier mmorier commented Nov 11, 2015

I fix false positive for ControlStatementRule that we have notice in issue #189. To do that, I had to check condition's depth.

I also fix issue #187 with this PR in remove closing curly bracket from regex.

I had some function in String+Swiftlint to make easier substring and index search.

…ts in condition and several bad cases appears
@mmorier mmorier changed the title Improve ControlStatementRule for issue #189 Improve ControlStatementRule for issues #187 and #189 Nov 11, 2015
return self[from..<from + length]
}

public func lastIndexOf(search: String) -> Int {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not return -> Int?, returning nil instead of -1 when not found?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, dunno why I'm not use optional benefit for this function. I'll change it now.

@jpsim
Copy link
Collaborator

jpsim commented Nov 11, 2015

I like what you're doing here! I just had a few minor comments that I'd like you to address.

Could you also please add an entry to the CHANGELOG.md? Thanks!

@mmorier
Copy link
Contributor Author

mmorier commented Nov 11, 2015

Thank you. I like coded on this tool:-)
I forgot to add entries to the CHANGELOG.md. Wait a minute, I'll make it for my both PR.

@jpsim
Copy link
Collaborator

jpsim commented Nov 11, 2015

This is great. Thanks for the hard work, @mmorier. I've made you a SwiftLint contributor which should make it easier for you to contribute in the future 😄

jpsim added a commit that referenced this pull request Nov 11, 2015
Improve ControlStatementRule for issues #187 and #189
@jpsim jpsim merged commit d50c2a2 into realm:master Nov 11, 2015
@mmorier
Copy link
Contributor Author

mmorier commented Nov 11, 2015

Thanks!

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