Hacker News new | ask | show | jobs
by adamzapasnik 2036 days ago
I don't get what is the big problem. Just turn off the disturbing Cop. It's a linter not an AI-Linter to know what is expected.

I don't even think that this is RuboCop's fault but Ruby's. Because you can write said code in a lot of different ways (like shown in the post).

3 comments

> I don't even think that this is RuboCop's fault but Ruby's. Because you can write said code in a lot of different ways (like shown in the post).

Honestly, the problem is that rubocop was not designed by a community of experts. It started as the opinions of a singular person, one motivated to the point of writing a linter where none existed. As a result, it's heavily opinionated on trivial shit. Yes, you can configure it, but the out-of-box experience is overbearing.

I generally prefer https://relaxed.ruby.style which is ... a lot more chill.

Exactly - you don't even need to turn it off globally, just add the magic comment and then an explanation for why you are being explicit about returning nil. ezpz
The thing that you can write said code in a lot of different ways is not a fault but a feature for which Ruby is loved by many. As can be also seen from the article it lets a programmer to be neatly expressive in various different situations.

Now if you personally don't like this feature you should probably use a language which feature is that you can write a thing only in one way and no other.