-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 Lint/AmbiguousOperator warnings #1021 #1022
Conversation
So, this might we one we need to discuss @cucumber/cucumber-ruby @tooky and I, when pairing, have developed a convention that we use parentheses when we care about the return value, and not when we don't. I'm struggling to find the reference that inspired that style, but this article is a reference. I am fond of this style, but I'm more interested in consistency than pushing one particular style. If this parentheses-everywhere rules is easier to check with rubocop, I can live with it. What are other people's thoughts? |
@mattwynne That is an interesting convention and I wouldn't mind to keep 👍 . If we decided to keep the convention, it would be great to ignore these violations in the |
@mattwynne That's the convention I've long used myself, although, like you, I can't remember where I originally drew the inspiration. I suspect it flows naturally from Ruby's precedence rules: do_something transform(munge(a, b)) is easier to parse mentally than the equivalent but paren-less do_something transform munge a, b |
I think it's nice to use ruby's loose syntax for conventions - I remember Jim Weirich was a proponent of using But if we are going to have conventions like that, I like @nodo's suggestion to document them. There are others we developed, like always returning self from commands. We should definitely write them down. |
df64988
to
4e691d7
Compare
rebased to current master |
As previously suggested by @brasmusson in this comment I changed the PR message to "fix part of #1021" to inhibit Github to automatically close the related issue. |
@nodo can you re-run Travis CI tests? it seems false negative |
I agree we should at least document this. I don't suppose there's a way to actually get the linter to check for that convention is there? |
@hotovson thanks for your work, I have restarted the CI tests and indeed it was a false negative. @mattwynne unfortunately I don't think there is a easy way to get |
@nodo @mattwynne IMHO the only way is by custom cops |
So what's the consensus with this one @cucumber/cucumber-ruby? I hate to waste @hotovson's good work, but it does seem as though a documented convention would work better in this instance, rather than a hard style check. Do we agree? |
OK I'm closing this one rather than merging. I feel bad about your efforts @hotovson but I hope you understand. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
fix part of #1021