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

Forbid method calls on multi-line blocks #491

Closed
daviddavis opened this issue Sep 17, 2013 · 3 comments
Closed

Forbid method calls on multi-line blocks #491

daviddavis opened this issue Sep 17, 2013 · 3 comments
Assignees

Comments

@daviddavis
Copy link
Contributor

In our project, we forbid the following code as it's easy to miss the c call.

a do
  b
end.c

Here's a real-life example.

What do you all think about having an option in MultilineBlockChain to check for this?

@jonas054
Copy link
Collaborator

👍 Yes, I think that's a good idea. I can add a configuration option. Hmm, what to call it? Maybe AllowMethodCalledOnBlock? I'll set it to true by default.

@ghost ghost assigned jonas054 Sep 18, 2013
@bbatsov
Copy link
Collaborator

bbatsov commented Sep 18, 2013

Sounds good.

@daviddavis
Copy link
Contributor Author

That sounds great!

jonas054 added a commit to jonas054/rubocop that referenced this issue Sep 19, 2013
daviddavis pushed a commit to daviddavis/rubocop that referenced this issue Sep 21, 2013
Created new cop MethodCalledOnDoEndBlock to check for method calls on do/end
blocks. Closes rubocop#491.
bbatsov added a commit that referenced this issue Sep 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants