-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
switch SpaceAfterPunctuation mixin to use SpaceInsideHashLiteralBraces config #3016
Conversation
ping @bbatsov |
mild ping again @bbatsov |
Sorry, @ptarjan. I'm crazy busy and I don't have much time for RuboCop these days. |
@bbatsov bummer :( Well I just want to make sure to get this in before you cut another release. Is there another maintainer you can deputize? |
You can ask @jonas054 to review this PR. Next week should be less busy for me and I'll try to cut a new release then. |
Btw, what exactly is the purpose of the PR - it's not immediately obvious to me. |
@bbatsov Our config has different values for |
I understand your point, but I don't think this is the right approach. Maybe we should just raise an error when someone has set incompatible settings - after all the two cops tackle different issues. Or we should add some special handling for such edge cases. In general we aim to avoid coupling between cops unless they are very tightly linked. |
How are my two cops inconsistent? I like to have spaces for hashes and not have spaces for lambdas. I like that it differentiates them in the code. Right now this other cop tries to use one of the configs for spaces after a comma and a semicolon. I was hanging it to use the other config for spaces after a semicolon. Sent from my iPhone
|
One deals with blocks, one deals with hash literals - I don't see why they should share their configuration. |
Well the |
Guess I missed this. @jonas054 Do you remember why you did it like this? |
Ping. I'd be sad if 0.40 went out without this. |
Don't worry - I'm enjoying my California vacation so much, that I totally forgot about OSS. Guess 0.40 won't happen for a few more days. |
If you're anywhere near San Francisco during your vacation and want to see the Stripe office and have a free lunch, let me know :) |
@ptarjan I have finally started reviewing your changes. Sorry about the delay. One thing I've noticed is that the changed spec passes even with the current |
@@ -19,9 +19,14 @@ def investigate(processed_source) | |||
end | |||
end | |||
|
|||
def space_style_before_rcurly? |
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.
I can't find that we've used this technique before, checking "calling an abstract method". It's code that's impossible (more or less) to cover in tests. I don't think we need it. We'll find out in testing if any implementation is missing, even without it.
eafa67d
to
b82f220
Compare
I added a test there that fails on master. Do you still want the matrix test I added? |
@jonas054 thanks for the review |
Yes I think the individual cop specs are useful and should test each cop completely. The CLI specs are good for interactions between cops. But actually, it doesn't make much sense to configure You have a line that's too long in |
b82f220
to
bd13902
Compare
bd13902
to
689f04c
Compare
@jonas054 done. Thanks for the quick response. |
👍 Looks good! |
Having a trailing
,
in a Block won't compile and having a trailing;
in a hash won't compile. So they should use their respective configs.Before submitting a PR make sure the following are checked:
master
(if not - rebase it)and description in grammatically correct, complete sentences.