How to speed up Rubocop

A small bit of config that could speed up your Rubocop runs

Recently I’ve noticed that when I run Rubocop it seems to hang for ages before eventually running. This is not ideal when time could be better spent.

I had a look online and found this StackOverflow question with someone who had the same issue, which they ended up kindly answering as well. I put the following piece of configuration at the top of my .rubocop.yml file and it solved the issue:

inherit_mode:
  merge:
    - Exclude

This means that it won’t analyse files it shouldn’t i.e. node_modules.

Recent posts View all

JavaScript

Setting a more specific database type in Prisma

Prisma sets a default of TEXT for all String fields, here is how you can override that.

Ruby

Override database attribute types

Sometimes you don't have control over how your database handles information, so you need Rails to set it