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 == operator in ColonConfiguration #1368

Conversation

SiarheiFedartsou
Copy link
Contributor

I think such issues can be easily detected by linter. We can add "identical operands in comparison operator" rule. I've tried to add it, but it is not so simple as it seemed to be. As I understand for now SourceKit give access to code structure only(like classes, functions, ifs, whiles etc), but not to expressions. So there is no easy way to parse for example "return A == B" or "if (A == B)" to know what is A and what is B.
Maybe someone have some ideas how we can write this rule?

@marcelofabri
Copy link
Collaborator

@SiarheiFedartsou there's no easy way to do this, I guess. The best we can probably do is come up with something using regexes, as in operator_usage_whitespace rule. However, it's not 100% reliable.

I've filled #1371 to track this rule request.

@marcelofabri marcelofabri merged commit 843b838 into realm:master Mar 19, 2017
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