-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Conversation
…ts in condition and several bad cases appears
return self[from..<from + length] | ||
} | ||
|
||
public func lastIndexOf(search: String) -> Int { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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! |
Thank you. I like coded on this tool:-) |
…on variable name
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 😄 |
Thanks! |
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.