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
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?
RuboCop 0.80: Ruby static code analyzer and code formatter
41–50 of 54 posts
Re: RuboCop 0.80: Ruby static code analyzer and code formatter
#42Earlier quoted context omitted.
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?
I'm fairly new to Ruby after having many years of Python and JS experience. One of the most annoying things I find with Rubocop is it asks me to break every 5-10 lines or so into a separate method by default. I mean, Ruby is not a particularly verbose language, so I don't understand why a linter will encourage people to break non-reusable details that are only a couple of lines long into separate methods. I mean, if…
> Do Rubyist really write code like this as a second nature?
In my opinion yes, only the "old timers" that came from some other technologies write these annoyingly long methods (with many temp variables) and then they "wine" about rubocop.
> I mean, if I have to jump around half a dozen different methods and classes every time I look at a method, does it really help comprehension at all?
If you have to jump around, then the method names were chosen badly.
Re: RuboCop 0.80: Ruby static code analyzer and code formatter
#43In 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
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?
Re: RuboCop 0.80: Ruby static code analyzer and code formatter
#44In 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
Re: RuboCop 0.80: Ruby static code analyzer and code formatter
#45A related thread from 2015: https://news.ycombinator.com/item?id=9162711 Since the project hasn't been discussed much on HN, we changed the URL from https://github.com/rubocop-hq/rubocop/releases/tag/v0.80.0 to the project page.
Re: RuboCop 0.80: Ruby static code analyzer and code formatter
#46Takes 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!”
Re: RuboCop 0.80: Ruby static code analyzer and code formatter
#47Earlier quoted context omitted.
80 characters is nice for side by side buffers. Also, lines that are too long horizontally are difficult to scan (especially if they are much longer than the lines around them) and can benefit from some work on vertical layout.
How much time do developers spend on side by side buffers? I get the difficult to scan point (although I find it subjective) but the side-by-side argument is optimizing for a comparatively small use case.
> How much time do developers spend on side by side buffers?
In my case: all the time. On my desktop (which has a large display) I often tend to have 3-4 vertical buffers open. Being able to fit all my code in those buffers is a godsend.Re: RuboCop 0.80: Ruby static code analyzer and code formatter
#48Earlier quoted context omitted.
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?
Not every rule has a reason, some of it is just "because style guide" and if you try to look up the rationale there, you'll find none. Classic example is Perl style %w(literal arrays) vs ['traditional', 'arrays']. > Prefer `%w` to the literal array syntax when you need an array of strings Which was introduced[1] into the style guide nearly 9 years ago with practically no reasoning. Prefer `%w` because why exactly? [1…
Re: RuboCop 0.80: Ruby static code analyzer and code formatter
#49In 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
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…
Re: RuboCop 0.80: Ruby static code analyzer and code formatter
#50Earlier quoted context omitted.
I would ask if you're doing Ruby, or object oriented design? Because the first rule of SOLID is Single-Responsibility, and there is this great concept frequently repeated in the OO design circles of Ruby conference talks, "I just want to send a method to an object." I can't say for sure that your method longer than 5 lines is breaking this rule, but if I was a betting man, I'd bet it's breaking one of those rules. Ch…
I appreciate this detailed response, but I'm afraid if it takes an essay to respond to a simple question of "why break out if more than 5 lines", and the reader with 15 years of programming experience who's well-versed in half a dozen general purpose prog langs still haven't got a clue after reading it, it suggests to me that this is cargo-cult programming. Ruby is not the first language that has OOPish constructs, b…