Shared Rubocop config used in my Ruby / Rails projects.
Add this line to your application's Gemfile:
gem 'rubocop-config', github: 'AndreasBaumgart/rubocop-config'
And then execute:
$ bundle
There are 2 ways we can add these configs to your project.
Add these lines to your .rubocop.yml
:
# /.rubocop.yml
inherit_gem:
rubocop-config:
- config/rubocop.yml
# Some files define `Exclude` for same cops. To merge the `Exclude` rules, add:
inherit_mode:
merge:
- Exclude
The example below assumes you want to fetch from the latest config (i.e., from master
branch).
This is recommended if you prefer not to install any gem. Rubocop will download and cache copies of these config files locally.
For more details, please see the Rubocop documents here
Add these lines to your .rubocop.yml
# /.rubocop.yml
inherit_from:
- https://raw.githubusercontent.com/AndreasBaumgart/rubocop-config/master/config/rubocop.yml
Add these lines to your .gitignore
if you wish not to commit the cached copies of these files
# .gitignore
.rubocop-*
The gem is available as open source under the terms of the MIT License.