Rubocop shared configurations for projects
add the follow line into your Gemfile
group :test, :development do
gem 'rubocop-config-captive'
end
And then in a terminal
$ bundle install
[...]
# /.rubocop.yml
inherit_gem:
rubocop-config-captive:
- config/default.yml
# -OR-
# - config/rubocop-XXX.yml
😩 My project has too many errors
the configuration is very strict, it is normal to have many errors
bundle exec rubocop -a
bundle exec rubocop --auto-gen-config
Will create .rubocop_todo.yml
will all non passing rules. It is advised to fix them later, rule by rule.
📍 Gemfile
has lots of Bundler/GemVersion
errors
Each dependency should be explicitly set in the Gemfile
and bundle update
is strongly discouraged.
- Install bundle-locker globally
gem install bundle-locker
- Pin Gemfile using
Gemfile.lock
bundle-locker ./Gemfile
-
Manually edit
Gemfile
and adjust constraints"x.x.x"
,"~> x.x.x"
, etc -
Update
Gemfile.lock
bundle install
To contribute, here are some inspirations for good configurations :
MIT © Captive Studio [email protected]
rubocop-config-captive is maintained and funded by Captive. The names and logos for captive are trademarks of captive-studio.
We love open source software! See our other projects or hire us to design, develop, and grow your product.