-
Notifications
You must be signed in to change notification settings - Fork 1
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
Turn off annoying cops #3
Comments
@fnoeh commented: “Align Florian’s version: def buyer_seller_relation
@buyer_seller_relation ||= if same_country?
:home
elsif buyer_in_eu?
:eu
else
:rest
end
end According to Rubocop, this is bad.
This is Rubocop’s preferred variant: def buyer_seller_relation
@buyer_seller_relation ||= if same_country?
:home
elsif buyer_in_eu?
:eu
else
:rest
end
end Florian’s opinion: With ruby’s standard of 2 spaces per indentation level, in this example we are actually no longer using a multiple of 2 spaces because the consecutive lines are indented by 27 and 29 spaces in order to be aligned with This is so awkward and I have never seen this used in any other programming language that programmer’s editors typically do not even support this kind of indentation. |
As I remember, you can please Rubocop and have Ruby (& editor) standard by doing this (also much cleaner in my opinion):
Conclusion is that I would keep the cop. |
Kill this rule |
This rule is crucial for understanding the output text (presentation of error/failure) when having nested contexts and for spotting the difference between closest |
But the rule prevents you from writing contexts like this: context "when there is a shipping setting" do
context "but it doesn’t have free_shipping_threshold set" do
...
end
end |
Kill this. The example on that page is definitely bad, but this also prevents general organization of |
http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies Code climate enforces |
https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier I'm all for doing |
A radical thought: how about we kill all cops that want to enforce the style of I, for instance, am totally fine with using In the extreme case that anyone should desire to introduce |
Closing this per decision made at backend chapter to create individual issues per rubocop rule |
I would like to keep this open so that we have time to open new issues for the things mentioned here. Let's try this process if you want a rule changed:
|
@fnoeh 👍 for reopening this.
Why not a new PR?
This sounds like a lot of operational overhead to me; how about – to keep this lightweight – we instead require one approval by a reviewer, just like in other repos, and if someone is opposed to a change, they can request changes in the PR. If no consensus is found, then we can escalate to an arbitrator… |
RIP 👮♂️ |
As discussed in a recent Backend chapter meeting, let’s collect here Rubocop rules that we don’t find helpful, i.e. rules that provide so little value that they’re not worth the effort to fix CodeClimate issues.
Then we can disable them for all Ruby projects.
Comment here with your favourite pointless cop that you’d love to retire! 🔥
The text was updated successfully, but these errors were encountered: