top | item 22357653

RuboCop 0.80: Ruby static code analyzer and code formatter

70 points| tosh | 6 years ago |docs.rubocop.org | reply

51 comments

order
[+] StaticRedux|6 years ago|reply
In my opinion RuboCop is too strict. Every code standard analyzer takes some tweaking to get it set up for a particular project and team standards, but RuboCop needs changing of a ton of rules to make it even usable in a reasonable fashion.

I love it because it brings some order to a meta-everything world, but it'd be nice if it came with a reasonable set of rules by default

[+] phaedryx|6 years ago|reply
Every RuboCop rule is reasonable. That is, you can look up the reason and see if you agree or not.

Our team has overridden about a dozen rules (we bumped up line length and class length), but I find most of the default rules are fine.

Out of curiosity, what rules are unreasonable to you?

[+] yebyen|6 years ago|reply
The thing about that is, what's reasonable for you and your team is not always reasonable for me and my team.

Case and point, 80 character line limit: this was a reasonable limit when command lines were not usually rendered inside of high-res framebuffers, I have my font set to 12 point M+ font, which is a narrow width font, so my terminals are set to open at 180 characters wide and it only takes up half the width of my screen.

Most of the members of my team don't use this font, or even the same terminal, so I think that a 110 character limit is a good compromise, ...but I don't work alone, and so if we're going to set a standard, it should be a discussion and we should all have input before it's agreed to.

On the other hand you have tools like Rufo (or prettier, or gofmt) where these kinds of discussions are considered as wasteful and inviting unnecessary conflict about the color of the bike shed. There's a strong argument to be made that there is a reasonable default for standards, and it follows that we all should use the same standards as everyone else, and be glad that there's only one standard to worry about!

Rubocop is a much bigger tool than Rufo. I am glad, personally, that the developers of these tools talk to each other, and in some cases they have made efforts to make sure the defaults of both tools do not step on each other, which would make it impossible to use the two slightly orthogonal tools together on the same project. (I hope my team will find the means to adopt one or both of these tools soon!)

[+] existentialmutt|6 years ago|reply
This has been my experience too. Fortunately rubocop makes it easy to distribute alternate settings as gems. I use https://github.com/sider/meowcop as a reasonable base setting. It's more relaxed about style and makes rubocop more of a linter, which is what I want.
[+] predators372|6 years ago|reply
What are some pain points in your experience? You don't have to be super specific but I'm just curious what parts get in your way when you use it with standard config?
[+] hestefisk|6 years ago|reply
Takes the prize for best open source project name (and logo). FWIW I was a huge Robocop fan as a child. It’s filled with fantastic one liners: “Dead or alive, you are coming with me.” “I’ll buy that for a dollar.” “Serve the public trust, protect the innocent, uphold the law.” “Who cares if it works or not? Spare parts for 25 years!”