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

Inconsistence between ruby-style-guide for fail/raise and rubocop implementation #2732

Closed
afdev82 opened this issue Jan 28, 2016 · 4 comments

Comments

@afdev82
Copy link

afdev82 commented Jan 28, 2016

I noticed that rubocop has a dead link to https://github.com/bbatsov/ruby-style-guide#fail-method and the current rule in the README (https://github.com/bbatsov/ruby-style-guide#prefer-raise-over-fail) is exactly the contrary of what rubocop currently checks.
I think we should align the implementation to the guide.

@stamhankar999
Copy link

+1 to do something here. I ran rubocop on my code yesterday and noticed many raise's turned into fail's. I googled raise vs. fail, and found https://www.relishapp.com/womply/ruby-style-guide/docs/exceptions, which implies that rubocop's behavior is correct. But as you said, the style guide that bbatsov wrote says otherwise.

The question of how to proceed boils down to which style guide we follow. If relishapp, then we should update the style-guide that bbatsov wrote. If the bbatsov guide wins, then rubocop impl should be updated.

@alexdowad
Copy link
Contributor

Is there any objective reason to prefer one over the other? Or is it just a case of picking whichever one seems more descriptive?

@bbatsov
Copy link
Collaborator

bbatsov commented Jan 28, 2016

It should be addressed by making raise the default in RuboCop. The guide was recently updated after years of debating the subject.

@bbatsov
Copy link
Collaborator

bbatsov commented Jan 28, 2016

Is there any objective reason to prefer one over the other? Or is it just a case of picking whichever one seems more descriptive?

There are reasons, but they aren't important for this particular ticket. :-) I'm fine with always using raise and it seems the majority of people are doing this anyways.

hakanensari added a commit to lineofflight/peddler that referenced this issue Mar 3, 2016
johnallen3d added a commit to telus-agcg-archive/grape-apiary that referenced this issue Mar 9, 2016
There has been a change to the Ruby Style Guide. See here for recent
discussion: rubocop/rubocop#2732
johnallen3d added a commit to telus-agcg-archive/grape-apiary that referenced this issue Mar 9, 2016
There has been a change to the Ruby Style Guide. See here for recent
discussion: rubocop/rubocop#2732
smortex added a commit to opus-codium/puffy that referenced this issue Mar 13, 2016
Policy seems to have changed recently
rubocop/rubocop#2732 (comment)
Szeliga pushed a commit to lineofflight/peddler that referenced this issue Jul 25, 2016
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

No branches or pull requests

4 participants