RuboCop Standard
This repository enables all of Shopify's recommended RuboCop configurations, plus some extra ones I've found useful for my projects, like:
Installation
Gemfile
gem "rubocop-standard".rubocop.yml
require:
- rubocop-standardHow to configure
In your .rubocop.yml file, just write:
inherit_gem:
rubocop-standard:
- config/default.ymlBy default, rubocop-performance and rubocop-rake rules are enforced, because it's assumed that every Ruby project cares about these two sets. Why? Well, everyone should care about performance, and every project uses Rake (and Bundler) as de facto tools.
This gem also has the following Rubocop tools as dependencies:
rubocop-minitestrubocop-railsrubocop-rails-accessibilityrubocop-sorbet
You can add those in for whichever project needs them:
inherit_gem:
rubocop-standard:
- config/default.yml
- config/minitest.yml
- config/rails.yml # includes rails-accessibilityOther features
This project also excludes directories that are ancillary to the core lib code:
AllCops:
Exclude:
- bin/**/*
- db/**/*
- node_modules/**/*
- sorbet/**/*
- tmp/**/*
- vendor/**/*Rails environments also includes staging:
Rails/UnknownEnv:
Environments:
- development
- test
- staging
- production