DBL Rubocop
RuboCop configuration for our Ruby on Rails projects.
Official RoR RuboCop Configuration.
Releases are published to RubyGems.
Installation
group :development, :test do
gem 'rubocop-dbl'
endSetup
run
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.ymlConfiguration
TargetRubyVersion
We 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.
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.2Build & install gem locally
gem build rubocop-dbl.gemspec
gem install rubocop-dbl-0.1.0.gemPublish on RubyGems
bin/releasewill guide you through the process.