Shared Rubocop config used by Moneytree's Ruby / Rails projects.
At Moneytree, many of our services are built on Ruby and Rails. As our team grows larger, it is necessary to keep all our codes in similar coding styles, while providing some level of flexibility to developers.
Instead of sticking with a particular coding style, and potentially introduce endless discussion about which one is better, we value:
- Less Error-Prone - Is one style easier to cause runtime error than another?
- Code Readability - Is one style more readable than another?
- Easy On-Boarding - Is it easy for new developers to get used to this coding style?
- Shared Knowledge - Does this coding style apply to most of our active projects?
Interested in working at the cutting-edge FinTech industry in Japan? Please visit our Careers Page for open positions.
Add this line to your application's Gemfile:
gem 'moneytree-rubocop-config', github: 'moneytree/rubocop-config'
And then execute:
$ bundle
Or install it yourself as:
$ gem install moneytree-rubocop-config
There are 2 ways we can add these configs to your project.
Add these lines to your .rubocop.yml
:
# /.rubocop.yml
inherit_gem:
moneytree-rubocop-config:
- rubocop.yml
- rubocop.rails.yml # for Ruby on Rails
- rubocop.test.yml # for MiniTest and RSpec
- rubocop.cucumber.yml # for Cucumber
# Some files define `Exclude` for same cops. To merge the `Exclude` rules, add:
inherit_mode:
merge:
- Exclude
The example below assumes you want to fetch from the latest config (i.e., from master
branch).
This is recommended if you prefer not to install any gem. Rubocop will download and cache copies of these config files locally.
For more details, please see the Rubocop documents here
Add these lines to your .rubocop.yml
# /.rubocop.yml
inherit_from:
- https://raw.githubusercontent.com/moneytree/rubocop-config/master/rubocop.yml
- https://raw.githubusercontent.com/moneytree/rubocop-config/master/rubocop.rails.yml # for Ruby on Rails
- https://raw.githubusercontent.com/moneytree/rubocop-config/master/rubocop.test.yml # for MiniTest and RSpec
- https://raw.githubusercontent.com/moneytree/rubocop-config/master/rubocop.cucumber.yml # for Cucumber
Add these lines to your .gitignore
if you wish not to commit the cached copies of these files
# .gitignore
.rubocop-*
TODO: write development instructions here
Bug reports and pull requests are welcome on GitHub at https://github.com/moneytree/rubocop-config.
The gem is available as open source under the terms of the MIT License.