RuboCop configuration for our Ruby on Rails projects.
Official RoR RuboCop Configuration.
Releases are published to RubyGems.
group :development, :test do
gem 'rubocop-dbl'
endrun
rails generate rubocop_dbl:installor manually Aad this line to your application's .rubocop.yml:
When using Rails:
require:
- rubocop-rails
inherit_gem:
rubocop-dbl:
- config/dbl.yml
- config/cops/rails.ymlWhen not using Rails:
inherit_gem:
rubocop-dbl:
- config/dbl.ymlWe only support the latest 2 versions of ruby, which is currently >= 2.7. We only support the latest 2 versions of rails, which is currently >= 6.0. See test.yml for details.
If you'd like to change TargetRubyVersion, see Customization.
If you'd like to customize the rubocop setting on your project, you can override it.
For example, if you want to change TargetRubyVersion, you can do it like:
# .rubocop.yml
inherit_gem:
rubocop-dbl:
- config/dbl.yml
# Override Setting
AllCops:
TargetRubyVersion: 2.7.2gem build rubocop-dbl.gemspec
gem install rubocop-dbl-0.1.0.gembin/releasewill guide you through the process.