The project is in a healthy, maintained state
Shared rubocop configuration for Captive projects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.12

Runtime

 Project Readme

Captive Rubocop config

License Gem Version

Rubocop shared configurations for projects

Install

add the follow line into your Gemfile

group :test, :development do
  gem 'rubocop-config-captive'
end

And then in a terminal

$ bundle install
[...]

Usage

# /.rubocop.yml
inherit_gem:
  rubocop-config-captive:
    - config/default.yml
    # -OR-
    # - config/rubocop-XXX.yml

Common Errors

😩 My project has too many errors

Explanation

the configuration is very strict, it is normal to have many errors

Solution

Solution 1 : Auto-correct all errors

bundle exec rubocop -a

Solution 2 : Ignore errors and progressively fix them

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

Explanation

Each dependency should be explicitly set in the Gemfile and bundle update is strongly discouraged.

Solution

Solution 1 : Use bundle-locker

  1. Install bundle-locker globally
gem install bundle-locker
  1. Pin Gemfile using Gemfile.lock
bundle-locker ./Gemfile
  1. Manually edit Gemfile and adjust constraints "x.x.x", "~> x.x.x", etc

  2. Update Gemfile.lock

bundle install

Contributing

To contribute, here are some inspirations for good configurations :

License

MIT © Captive Studio julien.polo@captive.fr

About Captive

captive

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.