solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Update Rubocop rules

Open kennyadsl opened this issue 3 years ago • 6 comments

We have quite an old set of Rubocop rules. We should evaluate the impact of updating the rules we have to a new set. Also, we should consider that at the moment Hound is performing the checks and we should be compatible with one of the versions they support.

kennyadsl avatar Dec 22 '20 16:12 kennyadsl

In my view, maintaining a set of Rubocop rules is more trouble than it is worth when we could use standard that allows us to avoid style arguments, avoid maintaining our own configs, and just use the default settings. I'm very much not a fan of Rubocop's defaults and it's not like standard has made all the same choices I would have, but I'm happy to go along with their choices, especially given the thoughtfulness they've put into each of them and how they've responded to community feedback and backed out of a couple controversial changes.

jarednorman avatar Jan 03 '21 22:01 jarednorman

I agree, it's probably better to switch to standard and stop worrying about coding style altogether rather than trying to come up with our own rules for every situation.

As for Hound, I think we should stop using it. Because of its architecture, it has a number of problems (mainly that you can't use any RuboCop plug-ins it doesn't support, and the way it handles comments on PRs) and there are better solutions out there nowadays. Even just running RuboCop as part of our CI would be a better (and much simpler) solution imo.

aldesantis avatar Jan 04 '21 08:01 aldesantis

I added standardrb in this project and it reports a ton of offenses:

1318 files inspected, 13047 offenses detected, 12974 offenses auto-correctable

Including things like Prefer double-quoted strings, indentation errors, etc.

Does it makes sense to make all these changes?

tejasbubane avatar Feb 12 '21 19:02 tejasbubane

Yeah, our current Rubocop configuration doesn't line up well with Standard's preferences. I'm not sure a wholesale update is feasible, but we're going to have to do something here. Do you happen to know what percentage of those offenses are just quotes? We can configure Standard to prefer single quotes and potentially make a couple other compromises if it make this update less prohibitive.

jarednorman avatar Feb 14 '21 21:02 jarednorman

@jarednorman I added standard, disabled a few rubocop rules and fixed some warnings. https://github.com/solidusio/solidus/pull/3951

For some reason I am getting a bunch of hound-ci warnings and CI failures.

tejasbubane avatar Feb 21 '21 19:02 tejasbubane

I explained over here that we're going to just stick with Rubocop for now. We can move forward with auditing the rules we're using and updating them.

jarednorman avatar Jun 16 '22 22:06 jarednorman