as a Ruby noobie I’m still trying to figure out best practices and such, so I was wondering what people’s opinions were on RuboCop. I’m generally a fan of linting and static analysis, but I know it’s a divisive topic.
I also noticed that running rubocop on a fresh Hanami project results in a lot of errors, so I’m assuming it isn’t used by the core team?
I personally find the default rules of Rubocop to be over-bearing and so typically turn off a bunch of things like Style/StringLiterals, Style/TrailingCommaInArrayLiteral, etc.
There’s an alternative out there in StandardRB that some people swear by. It provides you a set of rules as-is, and does not allow for the type of configuration that Rubocop does.
The RuboCop config linked by Ryan is really only intended for our internal repos, not for Hanami apps themselves. If you take a look at the config, it has a lot of rules configured or disabled that we’ve accrued over the years. I definitely wouldn’t recommend it as a starting point for others.