Inspired by https://blog.percy.io/share-rubocop-rules-across-all-of-your-repos-f3281fbd71f8
Ramsey shared RuboCop style configs.
https://www.sandimetz.com/blog/2017/6/1/why-we-argue-style
Add this line to your application's Gemfile:
group :test, :development do
gem "ramsey_cop"
end
And then run:
$ bundle install
If you're in a Rails app, you can now run:
$ rails generate ramsey_cop
If you're not in a Rails app, you will need to create a .rubocop.yml
with the following directives:
- Note: This will work locally, but will not work with CodeClimate. If you are using CodeClimate, see the documentation linked at the bottom of this page.
inherit_gem:
ramsey_cop:
- default.yml
Now, run:
$ bundle exec rubocop
You do not need to include rubocop directly in your application's dependencies. RamseyCop will include a specific version of rubocop
that is shared across all projects.